fix(mobile): reload web app if old db worker is still running

when switching back to the app.
This commit is contained in:
Tienson Qin
2025-10-11 16:11:35 +08:00
parent 1292ab4ce8
commit 4e5237e82a
3 changed files with 57 additions and 40 deletions

View File

@@ -32,7 +32,7 @@
(defonce *profile-state (volatile! {}))
(defonce *db-worker (atom nil))
(defonce *db-worker-client-id (atom nil))
(defonce *db-worker-client-id (atom (storage/get :db-worker-client-id)))
(defonce *editor-info (atom nil))
(defonce app-ready-promise (p/deferred))
@@ -2360,3 +2360,9 @@ Similar to re-frame subscriptions"
[days]
(reset! (:ui/highlight-recent-days @state) days)
(storage/set :ui/highlight-recent-days days))
(defn set-db-worker-client-id!
[new-id]
(when new-id
(reset! *db-worker-client-id new-id)
(storage/set :db-worker-client-id new-id)))