Skip to content

Commit 32bf2fd

Browse files
committed
Read command palette state at shortcut time
- Avoid stale closure in global chat shortcuts - Keep command-palette handling aligned with current store state
1 parent 646d05b commit 32bf2fd

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎apps/web/src/routes/_chat.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function ChatRouteGlobalShortcuts() {
2121
const selectedThreadKeysSize = useThreadSelectionStore((state) => state.selectedThreadKeys.size);
2222
const { activeDraftThread, activeThread, defaultProjectRef, handleNewThread, routeThreadRef } =
2323
useHandleNewThread();
24-
const commandPaletteOpen = useCommandPaletteStore((s) => s.open);
2524
const keybindings = useServerKeybindings();
2625
const terminalOpen = useTerminalStateStore((state) =>
2726
routeThreadRef
@@ -40,7 +39,7 @@ function ChatRouteGlobalShortcuts() {
4039
},
4140
});
4241

43-
if (commandPaletteOpen) {
42+
if (useCommandPaletteStore.getState().open) {
4443
return;
4544
}
4645

@@ -90,7 +89,6 @@ function ChatRouteGlobalShortcuts() {
9089
activeDraftThread,
9190
activeThread,
9291
clearSelection,
93-
commandPaletteOpen,
9492
handleNewThread,
9593
keybindings,
9694
defaultProjectRef,

0 commit comments

Comments
 (0)