Skip to content

Commit 08a411e

Browse files
committed
Fix draft saving
1 parent 3d65860 commit 08a411e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/pages/ReadsEditor.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@ const ReadsEditor: Component = () => {
449449

450450
const lastDraft = lastSaved.draftId;
451451

452-
453452
const { success, note } = await sendDraft(
454453
user,
455454
article,
@@ -468,17 +467,22 @@ const ReadsEditor: Component = () => {
468467
draft: { ...note },
469468
mdContent: markdownContent(),
470469
time: note.created_at,
470+
draftId: note.id,
471471
}));
472472

473473
if (lastDraft.length > 0) {
474-
sendDeleteEvent(
474+
const delResponse = await sendDeleteEvent(
475475
user.pubkey,
476476
lastDraft,
477477
Kind.Draft,
478478
account.activeRelays,
479479
account.relaySettings,
480480
account.proxyThroughPrimal,
481481
);
482+
483+
if (delResponse.success && delResponse.note) {
484+
triggerImportEvents([delResponse.note], `del_last_draft_import_${APP_ID}`);
485+
}
482486
}
483487
}
484488
else {

0 commit comments

Comments
 (0)