enhance(ux): editing user avatar presence

This commit is contained in:
Tienson Qin
2026-01-21 19:29:34 +08:00
parent 8c74eb2736
commit 36c5afeece
13 changed files with 133 additions and 3 deletions

View File

@@ -102,6 +102,10 @@
(log/info :db-sync/stop true)
(state/<invoke-db-worker :thread-api/db-sync-stop))
(defn <rtc-update-presence!
[editing-block-uuid]
(state/<invoke-db-worker :thread-api/db-sync-update-presence editing-block-uuid))
(defn <rtc-get-users-info
[]
(when-let [graph-uuid (ldb/get-graph-rtc-uuid (db/get-db))]

View File

@@ -60,6 +60,10 @@
[]
(state/<invoke-db-worker :thread-api/rtc-stop))
(defn <rtc-update-presence!
[_editing-block-uuid]
(p/resolved nil))
(defn <rtc-branch-graph!
[repo]
(p/let [_ (js/Promise. user-handler/task--ensure-id&access-token)

View File

@@ -31,6 +31,12 @@
(db-sync-handler/<rtc-stop!)
(rtc-handler/<rtc-stop!)))
(defn <rtc-update-presence!
[editing-block-uuid]
(if (db-sync-enabled?)
(db-sync-handler/<rtc-update-presence! editing-block-uuid)
(rtc-handler/<rtc-update-presence! editing-block-uuid)))
(defn <rtc-branch-graph! [repo]
(rtc-handler/<rtc-branch-graph! repo))

View File

@@ -322,6 +322,9 @@
(defmethod handle :rtc/sync-state [[_ state]]
(state/update-state! :rtc/state (fn [old] (merge old state))))
(defmethod handle :rtc/presence-update [[_ {:keys [editing-block-uuid]}]]
(rtc-handler/<rtc-update-presence! editing-block-uuid))
(defmethod handle :rtc/log [[_ data]]
(state/set-state! :rtc/log data))