compose: Add button to save draft and start a new message.

This commit is contained in:
evykassirer
2024-01-19 14:12:26 -08:00
committed by Tim Abbott
parent fd4246def5
commit 3ef4e80dff
6 changed files with 50 additions and 2 deletions

View File

@@ -281,7 +281,10 @@ export function rename_stream_recipient(
}
export function snapshot_message(): LocalStorageDraft | undefined {
if (!compose_state.composing() || compose_state.message_content().length <= 2) {
if (
!compose_state.composing() ||
compose_state.message_content().length <= compose_state.MINIMUM_MESSAGE_LENGTH_TO_SAVE_DRAFT
) {
// If you aren't in the middle of composing the body of a
// message or the message is shorter than 2 characters long, don't try to snapshot.
return undefined;