From dce6fd104047c573e63b7695bad097cdd4cc1908 Mon Sep 17 00:00:00 2001 From: AustinMroz Date: Thu, 29 Jan 2026 16:26:07 -0800 Subject: [PATCH] Fix invalid keybind flash (#8435) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the save keybind action would - apply the new keybind - wait for a network request to persist the change - close the dialogue regardless of the results of the above changes During this network request, the dialog would show a warning that the keybind is invalid because the dialogue "contains a modified keybind which conflicts with an existing keybind" image This PR changes the order these actions are applied in. - The dialogue is immediately closed - The keybinding is updated if valid - The keybinding is persisted. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8435-Fix-invalid-keybind-flash-2f76d73d3650815c9657f35e77d331fe) by [Unito](https://www.unito.io) --- .../content/setting/KeybindingPanel.vue | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/components/dialog/content/setting/KeybindingPanel.vue b/src/components/dialog/content/setting/KeybindingPanel.vue index 03ca3df47..4ef7c3e95 100644 --- a/src/components/dialog/content/setting/KeybindingPanel.vue +++ b/src/components/dialog/content/setting/KeybindingPanel.vue @@ -265,18 +265,15 @@ function cancelEdit() { } async function saveKeybinding() { - if (currentEditingCommand.value && newBindingKeyCombo.value) { - const updated = keybindingStore.updateKeybindingOnCommand( - new KeybindingImpl({ - commandId: currentEditingCommand.value.id, - combo: newBindingKeyCombo.value - }) - ) - if (updated) { - await keybindingService.persistUserKeybindings() - } - } + const commandId = currentEditingCommand.value?.id + const combo = newBindingKeyCombo.value cancelEdit() + if (!combo || commandId == undefined) return + + const updated = keybindingStore.updateKeybindingOnCommand( + new KeybindingImpl({ commandId, combo }) + ) + if (updated) await keybindingService.persistUserKeybindings() } async function resetKeybinding(commandData: ICommandData) {