From d1e62af654982724ffc7194f397ac824a900f488 Mon Sep 17 00:00:00 2001 From: Alex Benzer Date: Thu, 1 Jan 2026 20:39:22 -0800 Subject: [PATCH] Drafts toast --- src/view/com/composer/Composer.tsx | 28 ++++++++++++++++---------- src/view/com/composer/DraftsDialog.tsx | 16 ++++++++++++--- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 86ae5bd6ca..84215f6bcb 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -479,6 +479,14 @@ export const ComposePost = ({ setViewMode('drafts') }, [clearDraft]) + // Handler for saving draft and closing with toast + const onSaveDraftAndClose = useCallback(() => { + saveImmediate(composerState) + closeComposer() + clearThumbnailCache(queryClient) + Toast.show(_(msg`Saved to drafts`)) + }, [_, saveImmediate, composerState, closeComposer, queryClient]) + // Handler for when a draft is deleted from the drafts list const onDraftDeleted = useCallback( (deletedDraftId: string) => { @@ -1086,17 +1094,12 @@ export const ComposePost = ({ Update draft? - Update draft and save it to post at a later time. + Update draft and save it to post later. { - // Explicitly save the changes before closing - saveImmediate(composerState) - closeComposer() - clearThumbnailCache(queryClient) - }} + onPress={onSaveDraftAndClose} /> Save to drafts? - Save to drafts to edit and post at a later time. + Save to drafts to edit and post later. - + Save to drafts? - Save to drafts to edit and post at a later time. + Save to drafts to edit and post later. Update draft? - Update draft and save it to post at a later time. + Update draft and save it to post later. - + {drafts.length === 0 ? ( - - + + No drafts yet