mirror of https://github.com/logseq/logseq
fix: catch error
parent
34d3ffe122
commit
ec504fe916
|
@ -342,7 +342,8 @@
|
||||||
(ui/button
|
(ui/button
|
||||||
(str "Open a local directory")
|
(str "Open a local directory")
|
||||||
:class "w-full rounded-t-none py-4"
|
:class "w-full rounded-t-none py-4"
|
||||||
:on-click #(page-handler/ls-dir-files!
|
:on-click #(->
|
||||||
|
(page-handler/ls-dir-files!
|
||||||
(fn [{:keys [url]}]
|
(fn [{:keys [url]}]
|
||||||
(file-sync-handler/init-remote-graph url)
|
(file-sync-handler/init-remote-graph url)
|
||||||
;; TODO: wait for switch done
|
;; TODO: wait for switch done
|
||||||
|
@ -365,12 +366,13 @@
|
||||||
(or (nil? info)
|
(or (nil? info)
|
||||||
(nil? (second info))
|
(nil? (second info))
|
||||||
(not= (second info) (:GraphUUID graph))))
|
(not= (second info) (:GraphUUID graph))))
|
||||||
(if (js/confirm "This directory is not empty, are you sure to sync the remote graph with it? Make sure to back up the directory first.")
|
(if (js/confirm "This directory is not empty, are you sure to sync the remote graph to it? Make sure to back up the directory first.")
|
||||||
(p/resolved nil)
|
(p/resolved nil)
|
||||||
(throw (js/Error. nil)))))))
|
(throw (js/Error. nil)))))))
|
||||||
|
|
||||||
;; cancel pick a directory
|
;; cancel pick a directory
|
||||||
(throw (js/Error. nil)))))}))
|
(throw (js/Error. nil)))))})
|
||||||
|
(p/catch (fn [^js e]))))
|
||||||
[:p.text-xs.opacity-50.px-1 (ui/icon "alert-circle") " An empty directory or an existing remote graph!"]]])
|
[:p.text-xs.opacity-50.px-1 (ui/icon "alert-circle") " An empty directory or an existing remote graph!"]]])
|
||||||
|
|
||||||
(defn pick-dest-to-sync-panel [graph]
|
(defn pick-dest-to-sync-panel [graph]
|
||||||
|
|
Loading…
Reference in New Issue