mirror of
https://github.com/logseq/logseq.git
synced 2026-05-05 03:16:37 +00:00
fix: notify graph dir is gone when starting or running the apps
Also, disabled both re-index and refresh when logseq detects that a graph's dir doesn't exists anymore.
This commit is contained in:
@@ -55,22 +55,10 @@
|
||||
(not (:encryption/graph-parsing? @state/state)))
|
||||
(cond
|
||||
(and (= "unlinkDir" type) dir)
|
||||
(do
|
||||
(state/pub-event! [:notification/show
|
||||
{:content (str "The directory " dir " has been renamed or deleted, the editor will be disabled for this graph, you can unlink the graph.")
|
||||
:status :error
|
||||
:clear? false}])
|
||||
(state/update-state! :file/unlinked-dirs (fn [dirs] (conj dirs dir))))
|
||||
(state/pub-event! [:graph/dir-gone dir])
|
||||
|
||||
(= "addDir" type)
|
||||
(when (contains? (:file/unlinked-dirs @state/state) dir)
|
||||
(notification/clear-all!)
|
||||
(state/pub-event! [:notification/show
|
||||
{:content (str "The directory " dir " has been back, you can edit your graph now.")
|
||||
:status :success
|
||||
:clear? true}])
|
||||
(fs/watch-dir! dir)
|
||||
(state/update-state! :file/unlinked-dirs (fn [dirs] (disj dirs dir))))
|
||||
(and (= "addDir" type) dir)
|
||||
(state/pub-event! [:graph/dir-back repo dir])
|
||||
|
||||
(contains? (:file/unlinked-dirs @state/state) dir)
|
||||
nil
|
||||
|
||||
Reference in New Issue
Block a user