浏览代码

fix(rtc): temp fix custom-decode for :block/name

rcmerci 5 天之前
父节点
当前提交
707ef76ad3
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/main/frontend/worker/rtc/full_upload_download_graph.cljs

+ 6 - 0
src/main/frontend/worker/rtc/full_upload_download_graph.cljs

@@ -39,6 +39,12 @@
    [:db/cardinality {:optional true} :keyword]
    [:db/cardinality {:optional true} :keyword]
    [:db/valueType {:optional true} :keyword]
    [:db/valueType {:optional true} :keyword]
    [:db/index {:optional true} :boolean]
    [:db/index {:optional true} :boolean]
+   ;; TODO: remove :block/name special custom-decode later
+   [:block/name {:optional true} [:string {:decode/custom
+                                           (fn [v] (try (ldb/read-transit-str v)
+                                                        (catch :default _
+                                                          (log/warn :non-transit-block-name v)
+                                                          v)))}]]
    [:malli.core/default [:map-of :keyword
    [:malli.core/default [:map-of :keyword
                          [:any {:decode/custom
                          [:any {:decode/custom
                                 (fn [x] ; convert db-id to db-id-string(as temp-id)
                                 (fn [x] ; convert db-id to db-id-string(as temp-id)