Skip to content

Commit 69f0df2

Browse files
committed
fix(rtc): some update-page-ops do not need update-block-attrs
1 parent 9f6cef2 commit 69f0df2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/frontend/worker/rtc/remote_update.cljs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,10 @@
557557
;; else
558558
nil))))
559559

560+
(defn- need-update-block-attrs-when-apply-update-page-op?
561+
[update-page-op-value]
562+
(seq (set/difference (set (keys update-page-op-value)) #{:op :self :page-name :block/title})))
563+
560564
(defn- apply-remote-update-page-ops
561565
[repo conn update-page-ops]
562566
(let [config (worker-state/get-config repo)]
@@ -578,7 +582,8 @@
578582
;; if there's already existing same name page
579583
(assert (= page-uuid self) {:page-name page-name :page-uuid page-uuid :should-be self})
580584
(assert (some? (d/entity @conn [:block/uuid page-uuid])) {:page-uuid page-uuid :page-name page-name})))
581-
(update-block-attrs repo conn self op-value)))))
585+
(when (need-update-block-attrs-when-apply-update-page-op? op-value)
586+
(update-block-attrs repo conn self op-value))))))
582587

583588
(defn- ensure-refed-blocks-exist
584589
"Ensure refed-blocks from remote existing in client"

0 commit comments

Comments
 (0)