fix: start rtc if ws state is :closing

pull/11055/head
Tienson Qin 2024-03-19 14:54:36 +08:00
parent f6513e0169
commit e523407738
2 changed files with 4 additions and 2 deletions

View File

@ -340,7 +340,9 @@
(state/set-state! :rtc/uploading? false)
;; No need to wait for rtc-start since it's a go loop that'll
;; return a value once it's stopped
(and (rtc-handler/<rtc-start! repo) false))
(and (p/do!
(rtc-handler/<rtc-stop!)
(rtc-handler/<rtc-start! repo)) false))
(p/catch (fn [error]
(reset! *creating-db? false)
(state/set-state! :rtc/uploading? false)

View File

@ -1129,7 +1129,7 @@
[repo conn token dev-mode?]
(go
(if-let [graph-uuid (ldb/get-graph-rtc-uuid @conn)]
(do (assert (and (contains? #{:closed nil} (some-> @*state :*ws deref ws/get-state))
(do (assert (and (contains? #{:closed :closing nil} (some-> @*state :*ws deref ws/get-state))
(contains? #{:closed nil} (some-> @*state :*rtc-state deref)))
(str
"*state should be :closed"