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.

popovers: Correct logic for visible reaction icon.

Karl Stolleya59f73027984
diff --git a/web/src/popover_menus_data.ts b/web/src/popover_menus_data.ts
index 781787db40f..edd3f932b9b 100644
--- a/web/src/popover_menus_data.ts
+++ b/web/src/popover_menus_data.ts
@@ -217,7 +217,8 @@ export function get_actions_popover_content_context(message_id: number): ActionP
function is_add_reaction_icon_visible(): boolean {
assert(message_lists.current !== undefined);
const $message_row = message_lists.current.get_row(message_id);
- return $message_row.find(".message_controls .reaction_button").css("display") !== "none";
+ const $reaction_button = $message_row.find(".message_controls .reaction_button");
+ return $reaction_button.length === 1 && $reaction_button.css("display") !== "none";
}
// Since we only display msg actions and star icons on windows smaller than
diff --git a/web/tests/popover_menus_data.test.cjs b/web/tests/popover_menus_data.test.cjs
index 145b03a3e49..e6ca26ce8c8 100644
--- a/web/tests/popover_menus_data.test.cjs
+++ b/web/tests/popover_menus_data.test.cjs
@@ -31,6 +31,7 @@ function MessageListView() {
find(selector) {
assert.equal(selector, ".message_controls .reaction_button");
return {
+ length: 1,
css(property) {
assert.equal(property, "display");
return "none";