From 689c7172848f85f09b2786fb2fd485e1bc2d6386 Mon Sep 17 00:00:00 2001 From: Shubham Dhama Date: Thu, 26 Apr 2018 02:45:57 +0530 Subject: [PATCH] message_edit: Don't offer UI to edit topics after time limit. This fixes a couple places where with community topic editing, we'd show the edit-topic UI basically indefinitely. --- static/js/message_list_view.js | 2 +- static/js/ui_init.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/message_list_view.js b/static/js/message_list_view.js index d4fb153d45..32bccc01b7 100644 --- a/static/js/message_list_view.js +++ b/static/js/message_list_view.js @@ -87,7 +87,7 @@ function set_topic_edit_properties(group, message) { // to encourage updating them. Admins can also edit any topic. if (message.subject === compose.empty_topic_placeholder()) { group.always_visible_topic_edit = true; - } else if (page_params.is_admin || page_params.realm_allow_community_topic_editing) { + } else if (page_params.is_admin || message_edit.is_topic_editable(message)) { group.on_hover_topic_edit = true; } } diff --git a/static/js/ui_init.js b/static/js/ui_init.js index 1eb9d74201..32ecee7a31 100644 --- a/static/js/ui_init.js +++ b/static/js/ui_init.js @@ -34,7 +34,7 @@ function message_hover(message_row) { message_row.addClass('message_hovered'); current_message_hover = message_row; - if (!message.sent_by_me && !page_params.realm_allow_community_topic_editing) { + if (!message_edit.is_topic_editable(message)) { // The actions and reactions icon hover logic is handled entirely by CSS return; }