mirror of
https://github.com/logseq/logseq.git
synced 2026-05-27 14:14:24 +00:00
Warning on multiple tab/windows access to the same graph
This commit is contained in:
@@ -949,6 +949,14 @@
|
||||
(defmethod handle :editor/edit-block [[_ block pos id opts]]
|
||||
(editor-handler/edit-block! block pos id opts))
|
||||
|
||||
(defmethod handle :db/multiple-tabs-opfs-failed [_]
|
||||
;; close current tab or window
|
||||
(notification/show!
|
||||
(let [word (if (util/electron?) "window" "tab")]
|
||||
(util/format "Logseq doesn't support multiple %ss access to the same graph yet, please close this %s."
|
||||
word word))
|
||||
:warning false))
|
||||
|
||||
(defn run!
|
||||
[]
|
||||
(let [chan (state/get-events-chan)]
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
[promesa.core :as p]
|
||||
[frontend.util :as util]
|
||||
[frontend.handler.notification :as notification]
|
||||
[cljs-bean.core :as bean]))
|
||||
[cljs-bean.core :as bean]
|
||||
[frontend.state :as state]))
|
||||
|
||||
(defonce *sqlite (atom nil))
|
||||
|
||||
@@ -46,7 +47,9 @@
|
||||
(bean/->clj result)))
|
||||
(p/catch (fn [error]
|
||||
(prn :debug :list-db-error (js/Date.))
|
||||
(notification/show! [:div (str "SQLiteDB error: " error)] :error)
|
||||
(if (= "NoModificationAllowedError" (.-name error))
|
||||
(state/pub-event! [:db/multiple-tabs-opfs-failed])
|
||||
(notification/show! [:div (str "SQLiteDB error: " error)] :error))
|
||||
[])))))
|
||||
|
||||
(<unsafe-delete [_this repo]
|
||||
|
||||
Reference in New Issue
Block a user