compose_state: Reuse has_savable_message_content.

This commit is contained in:
Tim Abbott
2024-04-20 13:28:36 -07:00
parent 2c2dfa4c3d
commit 7beea02660
2 changed files with 2 additions and 5 deletions

View File

@@ -290,10 +290,7 @@ export function rename_stream_recipient(
}
export function snapshot_message(): LocalStorageDraft | undefined {
if (
!compose_state.composing() ||
compose_state.message_content().length <= compose_state.MINIMUM_MESSAGE_LENGTH_TO_SAVE_DRAFT
) {
if (!compose_state.composing() || !compose_state.has_savable_message_content()) {
// 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;