From 12f59bd5d4e0de98e3086bdcea5f6de1b5420654 Mon Sep 17 00:00:00 2001 From: Matthew Huebert Date: Wed, 26 Jul 2023 17:30:42 -0600 Subject: [PATCH] - fix: local source --- editor2/src/main/maria/cloud/views.cljs | 2 +- editor2/src/main/maria/editor/core.cljs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/editor2/src/main/maria/cloud/views.cljs b/editor2/src/main/maria/cloud/views.cljs index 6968126b..8518f005 100644 --- a/editor2/src/main/maria/cloud/views.cljs +++ b/editor2/src/main/maria/cloud/views.cljs @@ -73,7 +73,7 @@ [editor.core/editor params file])) (defn local-file [id] - {:file/id (str "local:" id) + {:file/id id :file/provider :file.provider/local}) (ui/defview local [{:as params :keys [local/id]}] diff --git a/editor2/src/main/maria/editor/core.cljs b/editor2/src/main/maria/editor/core.cljs index e0c296e6..09f092c3 100644 --- a/editor2/src/main/maria/editor/core.cljs +++ b/editor2/src/main/maria/editor/core.cljs @@ -135,7 +135,9 @@ (let [autosave! (h/use-memo persist/autosave-local-fn [id]) default-value (h/use-memo #(when file - (or (:file/source file) "")) + (or (:file/source @(persist/local-ratom id)) + (:file/source file) + "")) [id]) [ProseView ref-fn] (use-prose-view {:default-value default-value :on-change-state (fn [prev-state next-state]