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]