mirror of https://github.com/logseq/logseq
enhance: catch errors when app quits
parent
1ee0c240c3
commit
b96332122f
|
@ -244,7 +244,10 @@
|
||||||
(.focus win))))
|
(.focus win))))
|
||||||
|
|
||||||
(.on app "window-all-closed" (fn []
|
(.on app "window-all-closed" (fn []
|
||||||
|
(try
|
||||||
(search/close!)
|
(search/close!)
|
||||||
|
(catch js/Error _e
|
||||||
|
nil))
|
||||||
(.quit app)))
|
(.quit app)))
|
||||||
(.on app "ready"
|
(.on app "ready"
|
||||||
(fn []
|
(fn []
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
[]
|
[]
|
||||||
(-> (run-git! #js ["add" "./*"])
|
(-> (run-git! #js ["add" "./*"])
|
||||||
(p/catch (fn [error]
|
(p/catch (fn [error]
|
||||||
(if (string/includes? "permission denied error: unable to index file")
|
(if (string/includes? error "permission denied error: unable to index file")
|
||||||
(js/console.error error)
|
(js/console.error error)
|
||||||
(p/rejected error))))))
|
(p/rejected error))))))
|
||||||
|
|
||||||
|
|
|
@ -75,14 +75,6 @@
|
||||||
:on-click (fn []
|
:on-click (fn []
|
||||||
(state/set-modal! (encryption/encryption-dialog url)))}
|
(state/set-modal! (encryption/encryption-dialog url)))}
|
||||||
"🔐"])
|
"🔐"])
|
||||||
[:a.control.ml-4 {:title (if local?
|
|
||||||
"Sync with the local directory"
|
|
||||||
"Clone again and re-index the db")
|
|
||||||
:on-click (fn []
|
|
||||||
(repo-handler/re-index!
|
|
||||||
nfs-handler/rebuild-index!
|
|
||||||
page-handler/create-today-journal!))}
|
|
||||||
"Re-index"]
|
|
||||||
[:a.text-gray-400.ml-4 {:title "No worries, unlink this graph will clear its cache only, it does not remove your files on the disk."
|
[:a.text-gray-400.ml-4 {:title "No worries, unlink this graph will clear its cache only, it does not remove your files on the disk."
|
||||||
:on-click (fn []
|
:on-click (fn []
|
||||||
(repo-handler/remove-repo! repo))}
|
(repo-handler/remove-repo! repo))}
|
||||||
|
|
|
@ -301,12 +301,6 @@
|
||||||
{:desc "Rebuild search index"
|
{:desc "Rebuild search index"
|
||||||
:binding "mod+c mod+s"
|
:binding "mod+c mod+s"
|
||||||
:fn search-handler/rebuild-indices!}
|
:fn search-handler/rebuild-indices!}
|
||||||
:graph/re-index
|
|
||||||
{:desc "Re-index the whole graph"
|
|
||||||
:binding "mod+c mod+r"
|
|
||||||
:fn #(repo-handler/re-index!
|
|
||||||
nfs-handler/rebuild-index!
|
|
||||||
page-handler/create-today-journal!)}
|
|
||||||
:sidebar/open-today-page
|
:sidebar/open-today-page
|
||||||
{:desc "Open today's page in the right sidebar"
|
{:desc "Open today's page in the right sidebar"
|
||||||
:binding (if mac? "mod+shift+j" "alt+shift+j")
|
:binding (if mac? "mod+shift+j" "alt+shift+j")
|
||||||
|
|
Loading…
Reference in New Issue