Browse Source

perf(file): remove duplicate page id when batch write

defclass 4 years ago
parent
commit
a451d992b0
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/main/frontend/modules/outliner/file.cljs

+ 3 - 3
src/main/frontend/modules/outliner/file.cljs

@@ -23,9 +23,9 @@
     (file/save-tree page-block tree)))
 
 (defn write-files!
-  [pages]
-  (doseq [page pages]
-    (try (do-write-file! page)
+  [page-db-ids]
+  (doseq [page-db-id (set page-db-ids)]
+    (try (do-write-file! page-db-id)
          (catch js/Error e
            (notification/show!
             "Write file failed, please copy the changes to other editors in case of losing data."