mirror of https://github.com/logseq/logseq
enhance: notify db saved only for manual triggers
parent
4cca2e5f69
commit
e0fafe4725
|
@ -844,7 +844,7 @@
|
|||
:label "graph-setup"}))
|
||||
|
||||
(defmethod handle :graph/save-db-to-disk [[_ _opts]]
|
||||
(persist-db/export-current-graph!))
|
||||
(persist-db/export-current-graph! {:succ-notification? true}))
|
||||
|
||||
(defmethod handle :search/transact-data [[_ repo data]]
|
||||
(let [file-based? (config/local-file-based-graph? repo)
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
(<export-db repo {})))
|
||||
|
||||
(defn export-current-graph!
|
||||
[]
|
||||
[& {:keys [succ-notification?]}]
|
||||
(when (util/electron?)
|
||||
(when-let [repo (state/get-current-repo)]
|
||||
(when (config/db-based-graph? repo)
|
||||
|
@ -50,9 +50,10 @@
|
|||
(->
|
||||
(p/do!
|
||||
(<export-db repo {})
|
||||
(state/pub-event!
|
||||
[:notification/show {:content "The current db has been saved successfully to the disk."
|
||||
:status :success}]))
|
||||
(when succ-notification?
|
||||
(state/pub-event!
|
||||
[:notification/show {:content "The current db has been saved successfully to the disk."
|
||||
:status :success}])))
|
||||
(p/catch (fn [^js error]
|
||||
(js/console.error error)
|
||||
(state/pub-event!
|
||||
|
|
Loading…
Reference in New Issue