From afd7c1b0f06928c36d450d96c9c560d435625d1b Mon Sep 17 00:00:00 2001 From: Peng Xiao Date: Tue, 25 Oct 2022 14:54:28 +0800 Subject: [PATCH] fix(whiteboard): persisting whiteboard block collapsed state --- deps/graph-parser/src/logseq/graph_parser/extract.cljc | 10 +++++----- src/main/frontend/modules/outliner/file.cljs | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/deps/graph-parser/src/logseq/graph_parser/extract.cljc b/deps/graph-parser/src/logseq/graph_parser/extract.cljc index 2b918676f..fcdf53567 100644 --- a/deps/graph-parser/src/logseq/graph_parser/extract.cljc +++ b/deps/graph-parser/src/logseq/graph_parser/extract.cljc @@ -222,11 +222,11 @@ (let [_ (when verbose (println "Parsing start: " file)) {:keys [pages blocks]} (gp-util/safe-read-string content) blocks (map - (fn [block] - (-> block - (gp-util/dissoc-in [:block/parent :block/name]) - (gp-util/dissoc-in [:block/left :block/name]))) - blocks) + (fn [block] + (-> block + (gp-util/dissoc-in [:block/parent :block/name]) + (gp-util/dissoc-in [:block/left :block/name]))) + blocks) serialized-page (first pages) ;; whiteboard edn file should normally have valid :block/original-name, :block/name, :block/uuid page-name (-> (or (:block/name serialized-page) diff --git a/src/main/frontend/modules/outliner/file.cljs b/src/main/frontend/modules/outliner/file.cljs index 0989f0228..280ae3067 100644 --- a/src/main/frontend/modules/outliner/file.cljs +++ b/src/main/frontend/modules/outliner/file.cljs @@ -23,6 +23,7 @@ :block/format :block/created-at :block/updated-at + :block/collapsed? {:block/page [:block/uuid]} {:block/left [:block/uuid]} {:block/parent [:block/uuid]}]) @@ -33,6 +34,7 @@ (dissoc block :db/id :block/uuid ;; shape block uuid is read from properties + :block/collapsed? :block/content :block/format :block/left