mirror of
https://github.com/penpot/penpot.git
synced 2025-07-22 20:17:12 +02:00
✨ Improve how topic is managed on ws notifications
This commit is contained in:
parent
9409078069
commit
97a1bf15ef
6 changed files with 16 additions and 21 deletions
|
@ -80,9 +80,9 @@
|
|||
(->> stream
|
||||
(rx/filter (ptk/type? ::dws/message))
|
||||
(rx/map deref)
|
||||
(rx/filter (fn [{:keys [subs-id] :as msg}]
|
||||
(or (= subs-id uuid/zero)
|
||||
(= subs-id profile-id))))
|
||||
(rx/filter (fn [{:keys [topic] :as msg}]
|
||||
(or (= topic uuid/zero)
|
||||
(= topic profile-id))))
|
||||
(rx/map process-message))
|
||||
|
||||
;; Once the teams are fecthed, initialize features related
|
||||
|
|
|
@ -65,15 +65,16 @@
|
|||
(->> (rx/from initmsg)
|
||||
(rx/map dws/send))
|
||||
|
||||
|
||||
;; Subscribe to notifications of the subscription
|
||||
(->> stream
|
||||
(rx/filter (ptk/type? ::dws/message))
|
||||
(rx/map deref)
|
||||
(rx/filter (fn [{:keys [subs-id] :as msg}]
|
||||
(or (= subs-id uuid/zero)
|
||||
(= subs-id profile-id)
|
||||
(= subs-id team-id)
|
||||
(= subs-id file-id))))
|
||||
(rx/filter (fn [{:keys [topic] :as msg}]
|
||||
(or (= topic uuid/zero)
|
||||
(= topic profile-id)
|
||||
(= topic team-id)
|
||||
(= topic file-id))))
|
||||
(rx/map process-message))
|
||||
|
||||
;; On reconnect, send again the subscription messages
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue