fix: move shortcut install to handler start

pull/1672/head
Weihua Lu 2021-04-15 15:51:19 +08:00
parent 212e2592d1
commit fd0742b1f3
3 changed files with 6 additions and 6 deletions

View File

@ -276,12 +276,6 @@
(state/hide-custom-context-menu!)
(editor-handler/clear-selection! e)))))
{:did-mount (fn [state]
(shortcut/install-shortcuts!)
state)
:will-unmount (fn [state]
(shortcut/uninstall-shortcuts!)
state)}
[state route-match main-content]
(let [{:keys [open? close-fn open-fn]} state
close-fn (fn []

View File

@ -55,4 +55,5 @@
(defn stop []
;; stop is called before any code is reloaded
;; this is controlled by :before-load in the config
(handler/stop!)
(js/console.log "stop"))

View File

@ -18,6 +18,7 @@
[frontend.handler.editor :as editor-handler]
[frontend.handler.ui :as ui-handler]
[frontend.handler.web.nfs :as nfs]
[frontend.modules.shortcut.core :as shortcut]
[frontend.fs.watcher-handler :as fs-watcher-handler]
[frontend.ui :as ui]
[goog.object :as gobj]
@ -179,5 +180,9 @@
(reset! db/*sync-search-indice-f search/sync-search-indice!)
(db/run-batch-txs!)
(file-handler/run-writes-chan!)
(shortcut/install-shortcuts!)
(when (util/electron?)
(el/listen!))))
(defn stop! []
(shortcut/uninstall-shortcuts!))