fix(rtc): upload-graph

This commit is contained in:
rcmerci
2023-11-10 23:48:05 +08:00
parent c92115bdd5
commit 60e404902d
3 changed files with 9 additions and 3 deletions

View File

@@ -14,7 +14,7 @@
[:tags {:optional true} [:maybe [:sequential :uuid]]]
[:properties {:optional true} [:maybe :string ; transit-json-string
]]
[:link {:optional true} :uuid]])
[:link {:optional true} [:maybe :uuid]]])
(def general-attr-set
(into #{} (map first) general-attrs-schema-coll))

View File

@@ -5,7 +5,9 @@
(:require [cljs.core.async :as async :refer [<! go]]
[fipp.edn :as fipp]
[frontend.db :as db]
[frontend.db.conn :as conn]
[frontend.db.rtc.core :as rtc-core]
[frontend.db.rtc.db-listener :as db-listener]
[frontend.db.rtc.full-upload-download-graph :as full-upload-download-graph]
[frontend.db.rtc.op-mem-layer :as op-mem-layer]
[frontend.db.rtc.ws :as ws]
@@ -58,7 +60,9 @@
(go
(let [state (<! (rtc-core/<init-state))
repo (state/get-current-repo)]
(<! (full-upload-download-graph/<upload-graph state repo)))))
(<! (full-upload-download-graph/<upload-graph state repo))
(let [conn (conn/get-db repo false)]
(db-listener/listen-db-to-generate-ops repo conn)))))
(rum/defcs ^:large-vars/cleanup-todo rtc-debug-ui <
rum/reactive

View File

@@ -51,8 +51,10 @@
(let [r (<! (get-result-ch))]
(if-not (:graph-uuid r)
(ex-info "upload graph failed" r)
(do (op-mem-layer/update-graph-uuid! repo (:graph-uuid r))
(do (op-mem-layer/init-empty-ops-store! repo)
(op-mem-layer/update-graph-uuid! repo (:graph-uuid r))
(op-mem-layer/update-local-tx! repo (:t r))
(<! (op-mem-layer/<sync-to-idb-layer! repo))
r)))))))
(def block-type-ident->str