Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

compose_ui: Split ComposePlaceholderOptions by message type.

evykassirerc083d7c126a7
diff --git a/web/src/compose_ui.ts b/web/src/compose_ui.ts
index 2a9e97de615..8c2eeefb0e7 100644
--- a/web/src/compose_ui.ts
+++ b/web/src/compose_ui.ts
@@ -22,7 +22,6 @@ import * as stream_data from "./stream_data";
import * as user_status from "./user_status";
import * as util from "./util";
-type MessageType = "stream" | "private";
type ComposeTriggeredOptions = {
trigger: string;
} & (
@@ -36,12 +35,16 @@ type ComposeTriggeredOptions = {
private_message_recipient: string;
}
);
-type ComposePlaceholderOptions = {
- direct_message_user_ids: number[];
- message_type: MessageType;
- stream_id: number;
- topic: string;
-};
+type ComposePlaceholderOptions =
+ | {
+ message_type: "stream";
+ stream_id: number;
+ topic: string;
+ }
+ | {
+ message_type: "private";
+ direct_message_user_ids: number[];
+ };
type SelectedLinesSections = {
before_lines: string;
separating_new_line_before: boolean;