diff --git a/src/app/components/CalendarEventForm.svelte b/src/app/components/CalendarEventForm.svelte
index 42e44ac5..cdbf78c4 100644
--- a/src/app/components/CalendarEventForm.svelte
+++ b/src/app/components/CalendarEventForm.svelte
@@ -36,7 +36,9 @@
const back = () => history.back()
- const submit = () => {
+ const selectFiles = () => editor.then(ed => ed.chain().selectFiles().run())
+
+ const submit = async () => {
if ($uploading) return
if (!title) {
@@ -60,8 +62,9 @@
})
}
+ const ed = await editor
const event = createEvent(EVENT_TIME, {
- content: editor.getText({blockSeparator: "\n"}).trim(),
+ content: ed.getText({blockSeparator: "\n"}).trim(),
tags: [
["d", initialValues?.d || randomId()],
["title", title],
@@ -69,7 +72,7 @@
["start", start.toString()],
["end", end.toString()],
...daysBetween(start, end).map(D => ["D", D.toString()]),
- ...editor.storage.nostr.getEditorTags(),
+ ...ed.storage.nostr.getEditorTags(),
tagRoom(GENERAL, url),
PROTECTED,
],
@@ -119,10 +122,7 @@
-