mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
enhance(rtc): try to restart rtc when possible
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
(ns frontend.components.rtc.flows
|
||||
(:require [frontend.common.missionary-util :as c.m]
|
||||
[frontend.state :as state]
|
||||
[missionary.core :as m]))
|
||||
|
||||
(def rtc-log-flow
|
||||
(m/watch (:rtc/log @state/state)))
|
||||
|
||||
(def rtc-download-log-flow
|
||||
(m/eduction
|
||||
(filter #(= :rtc.log/download (:type %)))
|
||||
rtc-log-flow))
|
||||
|
||||
(def rtc-upload-log-flow
|
||||
(m/eduction
|
||||
(filter #(= :rtc.log/upload (:type %)))
|
||||
rtc-log-flow))
|
||||
|
||||
(def rtc-misc-log-flow
|
||||
(m/eduction
|
||||
(remove #(contains? #{:rtc.log/download :rtc.log/upload} (:type %)))
|
||||
rtc-log-flow))
|
||||
|
||||
(def rtc-state-flow
|
||||
(m/stream (m/watch (:rtc/state @state/state))))
|
||||
|
||||
(def rtc-online-users-flow
|
||||
(c.m/throttle
|
||||
500
|
||||
(m/eduction
|
||||
(map (fn [m]
|
||||
(when (and (= :open (:ws-state (:rtc-state m)))
|
||||
(:rtc-lock m))
|
||||
(:online-users m))))
|
||||
(dedupe)
|
||||
rtc-state-flow)))
|
||||
@@ -2,7 +2,7 @@
|
||||
"RTC state indicator"
|
||||
(:require [cljs-time.core :as t]
|
||||
[frontend.common.missionary-util :as c.m]
|
||||
[frontend.components.rtc.flows :as rtc-flows]
|
||||
[frontend.handler.db-based.rtc-flows :as rtc-flows]
|
||||
[frontend.state :as state]
|
||||
[frontend.ui :as ui]
|
||||
[frontend.util :as util]
|
||||
|
||||
Reference in New Issue
Block a user