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_closed_ui: Remove direct type from data-conversation-type.

Pratik Chanda486447b1d463
diff --git a/web/src/compose_closed_ui.ts b/web/src/compose_closed_ui.ts
index 187eb2b5462..4a31d269fb4 100644
--- a/web/src/compose_closed_ui.ts
+++ b/web/src/compose_closed_ui.ts
@@ -163,9 +163,7 @@ export function rewire_update_reply_button_state(value: typeof update_reply_butt
update_reply_button_state = value;
}
-function update_new_conversation_button(
- data_attribute_string: "direct" | "stream" | "non-specific",
-): void {
+function update_new_conversation_button(data_attribute_string: "stream" | "non-specific"): void {
$("#new_conversation_button").attr("data-conversation-type", data_attribute_string);
}
@@ -203,27 +201,22 @@ export function should_disable_compose_reply_button_for_direct_message(): boolea
}
export function update_buttons(update_type?: string): void {
- let disable_reply_button;
+ let disable_reply_button = false;
if (update_type === "direct") {
// Based on whether there's a direct message recipient for
// the current narrow_state.
disable_reply_button = should_disable_compose_reply_button_for_direct_message();
- } else {
+ } else if (update_type === "stream") {
// Based on whether there's a selected channel message in
// the current message list.
disable_reply_button = should_disable_compose_reply_button_for_stream();
+ } else {
+ // Default case for most views.
+ set_standard_text_for_reply_button();
}
- if (update_type === "direct" || update_type === "stream") {
- update_new_conversation_button(update_type);
- update_reply_button_state(disable_reply_button);
- return;
- }
-
- // Default case for most views.
- update_new_conversation_button("non-specific");
+ update_new_conversation_button(update_type === "stream" ? "stream" : "non-specific");
update_reply_button_state(disable_reply_button);
- set_standard_text_for_reply_button();
}
export function maybe_update_buttons_for_dm_recipient(): void {