fix: dedupe raw node choices

This commit is contained in:
Tienson Qin
2026-05-13 11:40:58 +08:00
parent b2fc00b31b
commit cf24914e6c
2 changed files with 15 additions and 3 deletions

View File

@@ -674,9 +674,11 @@
(defn- add-initial-node-choice
[initial-choices new-choice]
(let [node-choice-match? (fn [choice]
(let [choice-value (:value choice)
new-value (:value new-choice)]
(let [choice-node-value (fn [choice]
(or (:value choice) choice))
node-choice-match? (fn [choice]
(let [choice-value (choice-node-value choice)
new-value (choice-node-value new-choice)]
(or
(and (:db/id choice-value) (= (:db/id choice-value) (:db/id new-value)))
(and (:block/uuid choice-value) (= (:block/uuid choice-value) (:block/uuid new-value)))