🐛 Fix reset cancel shortcut (#10980)

This commit is contained in:
Eva Marco 2026-07-31 12:51:01 +02:00 committed by GitHub
parent ff32f104b9
commit 36553a7c6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 5 deletions

View File

@ -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))

View File

@ -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))]