MCPcopy Index your code
hub / github.com/codeaashu/claude-code / DesktopHandoff

Function DesktopHandoff

src/components/DesktopHandoff.tsx:27–185  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

25 }) => void;
26};
27export function DesktopHandoff(t0) {
28 const $ = _c(20);
29 const {
30 onDone
31 } = t0;
32 const [state, setState] = useState("checking");
33 const [error, setError] = useState(null);
34 const [downloadMessage, setDownloadMessage] = useState("");
35 let t1;
36 if ($[0] !== error || $[1] !== onDone || $[2] !== state) {
37 t1 = input => {
38 if (state === "error") {
39 onDone(error ?? "Unknown error", {
40 display: "system"
41 });
42 return;
43 }
44 if (state === "prompt-download") {
45 if (input === "y" || input === "Y") {
46 openBrowser(getDownloadUrl()).catch(_temp);
47 onDone(`Starting download. Re-run /desktop once you\u2019ve installed the app.\nLearn more at ${DESKTOP_DOCS_URL}`, {
48 display: "system"
49 });
50 } else {
51 if (input === "n" || input === "N") {
52 onDone(`The desktop app is required for /desktop. Learn more at ${DESKTOP_DOCS_URL}`, {
53 display: "system"
54 });
55 }
56 }
57 }
58 };
59 $[0] = error;
60 $[1] = onDone;
61 $[2] = state;
62 $[3] = t1;
63 } else {
64 t1 = $[3];
65 }
66 useInput(t1);
67 let t2;
68 let t3;
69 if ($[4] !== onDone) {
70 t2 = () => {
71 const performHandoff = async function performHandoff() {
72 setState("checking");
73 const installStatus = await getDesktopInstallStatus();
74 if (installStatus.status === "not-installed") {
75 setDownloadMessage("Claude Desktop is not installed.");
76 setState("prompt-download");
77 return;
78 }
79 if (installStatus.status === "version-too-old") {
80 setDownloadMessage(`Claude Desktop needs to be updated (found v${installStatus.version}, need v1.1.2396+).`);
81 setState("prompt-download");
82 return;
83 }
84 setState("flushing");

Callers

nothing calls this directly

Calls 6

openBrowserFunction · 0.85
getDownloadUrlFunction · 0.85
useInputFunction · 0.85
performHandoffFunction · 0.85
onDoneFunction · 0.50
errorMessageFunction · 0.50

Tested by

no test coverage detected