fix: add fs watcher when switching to another graph

pull/3275/head
Tienson Qin 2021-11-25 14:08:42 +08:00
parent 4dfadfaaf9
commit b8d2dc1458
1 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,7 @@
[frontend.state :as state]
[frontend.ui :as ui]
[frontend.util :as util]
[frontend.fs :as fs]
[frontend.version :as version]
[reitit.frontend.easy :as rfe]
[rum.core :as rum]
@ -196,7 +197,9 @@
(common-handler/reset-config! url nil)
(shortcut/refresh!)
(when-not (= :draw (state/get-current-route))
(route-handler/redirect-to-home!)))}})
(route-handler/redirect-to-home!))
(when-let [dir-name (config/get-repo-dir url)]
(fs/watch-dir! dir-name)))}})
switch-repos)
links (concat repo-links
[(when (seq switch-repos)