diff options
| author | Dax Raad <[email protected]> | 2025-12-15 19:33:17 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-12-15 19:35:18 -0500 |
| commit | 112c58abf516e4523fb698b868a710c40b271559 (patch) | |
| tree | ba7f47f02cc5cda42e5ac0d5ae563be3e452ac68 /packages/desktop/src/context | |
| parent | 0dce5173ccca05aa7bd9eaabab78fe1f5f4d4360 (diff) | |
| download | opencode-112c58abf516e4523fb698b868a710c40b271559.tar.gz opencode-112c58abf516e4523fb698b868a710c40b271559.zip | |
tui: refactor dialog system to use single active dialog instead of stack
Diffstat (limited to 'packages/desktop/src/context')
| -rw-r--r-- | packages/desktop/src/context/command.tsx | 6 | ||||
| -rw-r--r-- | packages/desktop/src/context/notification.tsx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/desktop/src/context/command.tsx b/packages/desktop/src/context/command.tsx index d4ef8e166..8fd76ee21 100644 --- a/packages/desktop/src/context/command.tsx +++ b/packages/desktop/src/context/command.tsx @@ -128,7 +128,7 @@ function DialogCommand(props: { options: CommandOption[] }) { groupBy={(x) => x.category ?? ""} onSelect={(option) => { if (option) { - dialog.clear() + dialog.close() option.onSelect?.("palette") } }} @@ -174,8 +174,8 @@ export const { use: useCommand, provider: CommandProvider } = createSimpleContex const suspended = () => suspendCount() > 0 const showPalette = () => { - if (dialog.stack.length === 0) { - dialog.replace(() => <DialogCommand options={options().filter((x) => !x.disabled)} />) + if (!dialog.active) { + dialog.show(() => <DialogCommand options={options().filter((x) => !x.disabled)} />) } } diff --git a/packages/desktop/src/context/notification.tsx b/packages/desktop/src/context/notification.tsx index 045361630..ee15bc34a 100644 --- a/packages/desktop/src/context/notification.tsx +++ b/packages/desktop/src/context/notification.tsx @@ -59,7 +59,7 @@ export const { use: useNotification, provider: NotificationProvider } = createSi time: Date.now(), viewed: false, } - switch (event?.type) { + switch (event.type) { case "session.idle": { const sessionID = event.properties.sessionID const [syncStore] = globalSync.child(directory) |
