Skip to content

Commit 3ad47e3

Browse files
BlankParticleadolago
authored andcommitted
fix: don't try to open command palette if a dialog is already open (anomalyco#9116)
1 parent 5a67253 commit 3ad47e3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/app/src/context/command.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ function DialogCommand(props: { options: CommandOption[] }) {
172172
export const { use: useCommand, provider: CommandProvider } = createSimpleContext({
173173
name: "Command",
174174
init: () => {
175+
const dialog = useDialog()
175176
const [registrations, setRegistrations] = createSignal<Accessor<CommandOption[]>[]>([])
176177
const [suspendCount, setSuspendCount] = createSignal(0)
177-
const dialog = useDialog()
178178

179179
const options = createMemo(() => {
180180
const seen = new Set<string>()
@@ -209,7 +209,7 @@ export const { use: useCommand, provider: CommandProvider } = createSimpleContex
209209
}
210210

211211
const handleKeyDown = (event: KeyboardEvent) => {
212-
if (suspended()) return
212+
if (suspended() || dialog.active) return
213213

214214
const paletteKeybinds = parseKeybind("mod+shift+p")
215215
if (matchKeybind(paletteKeybinds, event)) {

0 commit comments

Comments
 (0)