compose_ui: Rename message type to have correct casing.

This commit is contained in:
evykassirer 2024-04-01 15:02:32 -07:00 committed by Tim Abbott
parent e595b9d611
commit 86979b98c7
1 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ import * as user_status from "./user_status";
import * as util from "./util"; import * as util from "./util";
// TODO: Refactor to push this into a field of ComposeTriggeredOptions. // TODO: Refactor to push this into a field of ComposeTriggeredOptions.
type messageType = "stream" | "private"; type MessageType = "stream" | "private";
type ComposeTriggeredOptions = { type ComposeTriggeredOptions = {
trigger: string; trigger: string;
private_message_recipient: string; private_message_recipient: string;
@ -32,7 +32,7 @@ type ComposeTriggeredOptions = {
}; };
type ComposePlaceholderOptions = { type ComposePlaceholderOptions = {
direct_message_user_ids: number[]; direct_message_user_ids: number[];
message_type: messageType; message_type: MessageType;
stream_id: number; stream_id: number;
topic: string; topic: string;
}; };
@ -87,7 +87,7 @@ export function insert_and_scroll_into_view(
autosize_textarea($textarea); autosize_textarea($textarea);
} }
function get_focus_area(msg_type: messageType, opts: ComposeTriggeredOptions): string { function get_focus_area(msg_type: MessageType, opts: ComposeTriggeredOptions): string {
// Set focus to "Topic" when narrowed to a stream+topic // Set focus to "Topic" when narrowed to a stream+topic
// and "Start new conversation" button clicked. // and "Start new conversation" button clicked.
if (msg_type === "stream" && opts.stream_id && !opts.topic) { if (msg_type === "stream" && opts.stream_id && !opts.topic) {
@ -111,7 +111,7 @@ function get_focus_area(msg_type: messageType, opts: ComposeTriggeredOptions): s
// Export for testing // Export for testing
export const _get_focus_area = get_focus_area; export const _get_focus_area = get_focus_area;
export function set_focus(msg_type: messageType, opts: ComposeTriggeredOptions): void { export function set_focus(msg_type: MessageType, opts: ComposeTriggeredOptions): void {
// Called mainly when opening the compose box or switching the // Called mainly when opening the compose box or switching the
// message type to set the focus in the first empty input in the // message type to set the focus in the first empty input in the
// compose box. // compose box.