MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / submitPairing

Function submitPairing

packages/client/src/app/AppShell.tsx:2831–2855  ·  view source on GitHub ↗
(event: FormEvent<HTMLFormElement>)

Source from the content-addressed store, hash-verified

2829 }
2830
2831 async function submitPairing(event: FormEvent<HTMLFormElement>) {
2832 event.preventDefault();
2833 const code = pairingCode.trim();
2834 if (!code) {
2835 setPairingError("Enter the pairing code from the SimDeck terminal.");
2836 return;
2837 }
2838 setPairingBusy(true);
2839 setPairingError("");
2840 try {
2841 await pairBrowser(code);
2842 setPairingCode("");
2843 await refresh();
2844 } catch (error) {
2845 setPairingError(
2846 error instanceof ApiError && error.status === 401
2847 ? "Pairing code did not match."
2848 : error instanceof Error
2849 ? error.message
2850 : "Pairing failed.",
2851 );
2852 } finally {
2853 setPairingBusy(false);
2854 }
2855 }
2856
2857 return (
2858 <div className="app">

Callers

nothing calls this directly

Calls 2

pairBrowserFunction · 0.90
refreshFunction · 0.50

Tested by

no test coverage detected