From 36553a7c6f0731825dbf7112fe98832da2236e97 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Fri, 31 Jul 2026 12:51:01 +0200 Subject: [PATCH] :bug: Fix reset cancel shortcut (#10980) --- frontend/src/app/main/data/shortcuts.cljs | 1 + frontend/src/app/main/ui/shortcuts.cljs | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/data/shortcuts.cljs b/frontend/src/app/main/data/shortcuts.cljs index 84595c2b7f..19a473ae54 100644 --- a/frontend/src/app/main/data/shortcuts.cljs +++ b/frontend/src/app/main/data/shortcuts.cljs @@ -159,6 +159,7 @@ (if (and (contains? acc sc-key) (not (:disabled (get acc sc-key)))) (-> acc + (assoc-in [sc-key :original-command] (get-in acc [sc-key :command])) (assoc-in [sc-key :command] new-command) (update sc-key dissoc :show-command)) acc)) diff --git a/frontend/src/app/main/ui/shortcuts.cljs b/frontend/src/app/main/ui/shortcuts.cljs index 668d697e11..4499eac9ed 100644 --- a/frontend/src/app/main/ui/shortcuts.cljs +++ b/frontend/src/app/main/ui/shortcuts.cljs @@ -234,7 +234,9 @@ [k] (conj parent-id k)) item (if (:command item) - (assoc item :original-command (get original-commands k (:command item))) + (assoc item :original-command + (or (:original-command item) + (get original-commands k (:command item)))) item)] [k (assoc item :id item-id :children (walk (:children item) item-id))]))] (if sorted-comp @@ -373,8 +375,11 @@ conflict* (mf/use-state nil) conflict (deref conflict*) - reset-notification* (mf/use-state nil) - reset-pending* (mf/use-state false) + reset-notification* (mf/use-state nil) + reset-notification (deref reset-notification*) + + reset-pending* (mf/use-state false) + reset-pending (deref reset-pending*) clean-editing-state (fn [] @@ -524,7 +529,7 @@ :customized-key customized?)} (:final-key display-parts)]) (when-not (:finalized? display-parts) [:span {:class (stl/css :recording-ellipsis)} "..."])])] - (when-let [default-cmd @reset-notification*] + (when-let [default-cmd reset-notification] [:> context-notification* {:level :info :class (stl/css :modal-reset-msg)} (tr "shortcuts.edit-modal.reset-pending") [:> shortcuts-keys* {:content default-cmd @@ -532,7 +537,7 @@ :is-customized false :has-conflict? false}]]) - (when (and recorded-command (not (deref reset-pending*))) + (when (and recorded-command (not reset-pending)) (if conflict [:> context-notification* {:level :warning :class (stl/css :modal-error-msg)} (tr "shortcuts.edit-modal.conflict" (:name conflict))]