Skip to content

Commit

Permalink
- fix: local source
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuebert committed Jul 26, 2023
1 parent 6ef7be8 commit 12f59bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion editor2/src/main/maria/cloud/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]}]
Expand Down
4 changes: 3 additions & 1 deletion editor2/src/main/maria/editor/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 12f59bd

Please sign in to comment.