Skip to content

Commit 6d1c12b

Browse files
MarcoDotIOclaude
andcommitted
fix(web): keep the command palette compilable by React Compiler
The checkout choice guard used try/finally, which makes the compiler skip the whole component. settlePromise resets the guard the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent ae5e9ba commit 6d1c12b

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎apps/web/src/components/CommandPalette.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,16 +1883,16 @@ function OpenCommandPaletteDialog(props: {
18831883
// rejected as a conflict with the first.
18841884
if (checkoutChoiceSubmittingRef.current) return;
18851885
checkoutChoiceSubmittingRef.current = true;
1886-
try {
1887-
// The folder was just seen on disk; if it has gone, say so rather than recreate it.
1888-
await addFolderAsProject({
1886+
// The folder was just seen on disk; if it has gone, say so rather than recreate it.
1887+
const added = await settlePromise(() =>
1888+
addFolderAsProject({
18891889
environmentId,
18901890
workspaceRoot: choice.workspaceRoot,
18911891
createWorkspaceRootIfMissing: false,
1892-
});
1893-
} finally {
1894-
checkoutChoiceSubmittingRef.current = false;
1895-
}
1892+
}),
1893+
);
1894+
checkoutChoiceSubmittingRef.current = false;
1895+
if (added._tag === "Failure") throw squashAtomCommandFailure(added);
18961896
},
18971897
})),
18981898
},

0 commit comments

Comments
 (0)