compose_recipients: Fix broken compose state after restoring draft.

After restoring a draft with no recipient, compose was broken
as `message_type` assertion fails.
This commit is contained in:
Aman Agrawal
2024-05-07 04:08:47 +00:00
committed by Tim Abbott
parent 5b3641d92d
commit c0706ca9f6
2 changed files with 11 additions and 10 deletions

View File

@@ -22,6 +22,8 @@ import * as stream_data from "./stream_data";
import * as user_status from "./user_status";
import * as util from "./util";
export const DEFAULT_COMPOSE_PLACEHOLDER = $t({defaultMessage: "Compose your message here"});
export type ComposeTriggeredOptions = {
trigger: string;
} & (
@@ -333,7 +335,7 @@ export function compute_placeholder_text(opts: ComposePlaceholderOptions): strin
}
return $t({defaultMessage: "Message {recipient_names}"}, {recipient_names});
}
return $t({defaultMessage: "Compose your message here"});
return DEFAULT_COMPOSE_PLACEHOLDER;
}
export function set_compose_box_top(set_top: boolean): void {