fix: remove input-idle? check when saving file changes

This commit is contained in:
Tienson Qin
2022-04-28 12:49:36 +08:00
parent 46dedfb7eb
commit 2849d73dc6

View File

@@ -38,18 +38,15 @@
[pages]
(when (seq pages)
(when-not config/publishing?
(if (state/input-idle? (state/get-current-repo))
(doseq [[repo page-id] (set pages)]
(try (do-write-file! repo page-id)
(catch js/Error e
(notification/show!
[:div
[:p "Write file failed, please copy the changes to other editors in case of losing data."]
"Error: " (str (gobj/get e "stack"))]
:error)
(log/error :file/write-file-error {:error e}))))
(doseq [page pages]
(async/put! write-chan page))))))
(doseq [[repo page-id] (set pages)]
(try (do-write-file! repo page-id)
(catch js/Error e
(notification/show!
[:div
[:p "Write file failed, please copy the changes to other editors in case of losing data."]
"Error: " (str (gobj/get e "stack"))]
:error)
(log/error :file/write-file-error {:error e})))))))
(defn sync-to-file
[{page-db-id :db/id}]