Browse Source

fix: deleted enum choice effects existing blocks

Fixes LOG-2872
Tienson Qin 2 years ago
parent
commit
450b5d39a3
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/main/frontend/modules/outliner/core.cljs

+ 6 - 4
src/main/frontend/modules/outliner/core.cljs

@@ -201,10 +201,12 @@
                                              v
 
                                              (uuid? v)
-                                             (if (get-in (db/entity repo [:block/uuid v]) [:block/metadata :created-from-property])
-                                               ;; don't reference hidden block property values
-                                               []
-                                               [v])
+                                             (when-let [entity (db/entity repo [:block/uuid v])]
+                                               (let [from-property? (get-in entity [:block/metadata :created-from-property])]
+                                                 (if (and from-property? (not (contains? (:block/type entity) "closed value")))
+                                                   ;; don't reference hidden block property values except closed values
+                                                   []
+                                                   [v])))
 
                                              (and (coll? v) (string? (first v)))
                                              (mapcat block/extract-refs-from-text v)