fix: can't switch graphs

pull/10839/head
Tienson Qin 2023-12-29 17:21:54 +08:00
parent e8b5a93a7e
commit 6d0378c0d1
1 changed files with 8 additions and 7 deletions

View File

@ -183,13 +183,14 @@
state/set-state! :sync-graph/init? false)) state/set-state! :sync-graph/init? false))
(defmethod handle :graph/switch [[_ graph opts]] (defmethod handle :graph/switch [[_ graph opts]]
(p/let [^js sqlite @db-browser/*sqlite (let [^js sqlite @db-browser/*sqlite]
writes-finished? (.file-writes-finished? sqlite)] (p/let [writes-finished? (when sqlite (.file-writes-finished? sqlite))
(if (or writes-finished? (:sync-graph/init? @state/state)) writes-finished? (if (some? writes-finished?) writes-finished? true)]
(graph-switch-on-persisted graph opts) (if (or writes-finished? (:sync-graph/init? @state/state))
(notification/show! (graph-switch-on-persisted graph opts)
"Please wait seconds until all changes are saved for the current graph." (notification/show!
:warning)))) "Please wait seconds until all changes are saved for the current graph."
:warning)))))
(defmethod handle :graph/pull-down-remote-graph [[_ graph dir-name]] (defmethod handle :graph/pull-down-remote-graph [[_ graph dir-name]]
(if (mobile-util/native-ios?) (if (mobile-util/native-ios?)