enhance: presence debounce

This commit is contained in:
Tienson Qin
2026-01-30 17:27:49 +08:00
parent 63c9c65c95
commit 4c85d8ff26
2 changed files with 20 additions and 1 deletions

View File

@@ -233,6 +233,18 @@
@apply absolute top-1/2 -translate-y-1/2 pointer-events-none;
left: 6px;
z-index: 2;
opacity: 0;
animation: block-editing-avatar-fade-in 160ms ease-out forwards;
}
@keyframes block-editing-avatar-fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.ls-page-title .block-control-wrap {

View File

@@ -7,6 +7,7 @@
[frontend.handler.repo :as repo-handler]
[frontend.handler.user :as user-handler]
[frontend.state :as state]
[frontend.util :as util]
[lambdaisland.glogi :as log]
[logseq.db :as ldb]
[logseq.db-sync.malli-schema :as db-sync-schema]
@@ -166,9 +167,15 @@
(log/info :db-sync/stop true)
(state/<invoke-db-worker :thread-api/db-sync-stop))
(defonce ^:private debounced-update-presence
(util/debounce
(fn [editing-block-uuid]
(state/<invoke-db-worker :thread-api/db-sync-update-presence editing-block-uuid))
1000))
(defn <rtc-update-presence!
[editing-block-uuid]
(state/<invoke-db-worker :thread-api/db-sync-update-presence editing-block-uuid))
(debounced-update-presence editing-block-uuid))
(defn <rtc-get-users-info
[]