enhance: remove sqlite usage from Electron

Use periodic db export instead. Manual saving db to the disk can be
triggered by `mod+s`.
This commit is contained in:
Tienson Qin
2024-06-14 23:56:53 +08:00
parent 0f122e9a7e
commit 4cca2e5f69
11 changed files with 57 additions and 54 deletions

View File

@@ -42,7 +42,8 @@
[cljs-bean.core :as bean]
[frontend.handler.test :as test]
[frontend.persist-db.browser :as db-browser]
[frontend.db.async :as db-async]))
[frontend.db.async :as db-async]
[frontend.persist-db :as persist-db]))
(defn- set-global-error-notification!
[]
@@ -199,6 +200,8 @@
_ (mobile-util/hide-splash) ;; hide splash as early as ui is stable
repo (or (state/get-current-repo) (:url (first repos)))
_ (restore-and-setup! repo repos)]
(when (util/electron?)
(persist-db/run-export-periodically!))
(when (mobile-util/native-platform?)
(state/restore-mobile-theme!)))
(p/catch (fn [e]