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.

new conversation: Show correct tooltip when dms are disabled.

Kenneth Rodrigues245332eef4bb
diff --git a/web/src/compose_closed_ui.ts b/web/src/compose_closed_ui.ts
index 5f435d03a46..34439c3a8be 100644
--- a/web/src/compose_closed_ui.ts
+++ b/web/src/compose_closed_ui.ts
@@ -129,14 +129,18 @@ export function update_buttons_for_private(): void {
const text_stream = $t({defaultMessage: "Start new conversation"});
const is_direct_message_narrow = true;
const pm_ids_string = narrow_state.pm_ids_string();
+
+ let disable_reply;
+
if (!pm_ids_string || people.user_can_direct_message(pm_ids_string)) {
- $("#new_conversation_button").attr("data-conversation-type", "direct");
- update_buttons(text_stream, is_direct_message_narrow);
- return;
+ disable_reply = false;
+ } else {
+ // disable the [Message X] button when in a private narrow
+ // if the user cannot dm the current recipient
+ disable_reply = true;
}
- // disable the [Message X] button when in a private narrow
- // if the user cannot dm the current recipient
- const disable_reply = true;
+ $("#new_conversation_button").attr("data-conversation-type", "direct");
+
update_buttons(text_stream, is_direct_message_narrow, disable_reply);
}