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