0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-25 06:01:46 -05:00

🐛 Fix history panel doesn't close on esc

This commit is contained in:
Pablo Alba 2025-01-16 13:28:39 +01:00
parent fc4221b047
commit 21f4abf1b8
2 changed files with 28 additions and 1 deletions

View file

@ -0,0 +1,26 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.data.workspace.history
(:require
[app.main.data.workspace.common :as dwc]
[app.main.data.workspace.layout :as dwl]
[beicon.v2.core :as rx]
[potok.v2.core :as ptk]))
(defn initialize-history
[]
(ptk/reify ::initialize-history
ptk/WatchEvent
(watch [_ _ stream]
(let [clear-history-mode #(dwl/remove-layout-flag :document-history)]
(rx/merge
(rx/of (dwl/toggle-layout-flag :document-history))
(->> stream
(rx/filter dwc/interrupt?)
(rx/take 1)
(rx/map clear-history-mode)))))))

View file

@ -14,6 +14,7 @@
[app.main.data.shortcuts :as scd]
[app.main.data.workspace :as dw]
[app.main.data.workspace.drawing.common :as dwc]
[app.main.data.workspace.history :as dwh]
[app.main.data.workspace.shortcuts :as sc]
[app.main.refs :as refs]
[app.main.store :as st]
@ -197,7 +198,7 @@
(st/emit! :interrupt
(dw/clear-edition-mode)))
(st/emit! (-> (dw/toggle-layout-flag :document-history)
(st/emit! (-> (dwh/initialize-history)
(vary-meta assoc ::ev/origin "workspace-header")))))
open-share-dialog