From a601715e37f776c53983b5c8540b315c8376dbb4 Mon Sep 17 00:00:00 2001 From: klarabratteby <93648999+klarabratteby@users.noreply.github.com> Date: Tue, 1 Oct 2024 19:45:37 +0200 Subject: [PATCH] user_topic_popover: Remove all occurrences of instance.context. --- web/src/user_topic_popover.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/web/src/user_topic_popover.js b/web/src/user_topic_popover.js index bd608834f1..2317157691 100644 --- a/web/src/user_topic_popover.js +++ b/web/src/user_topic_popover.js @@ -32,18 +32,22 @@ export function initialize() { const topic_name = $elt.attr("data-topic-name"); $elt.addClass("visibility-policy-popover-visible"); - instance.context = - popover_menus_data.get_change_visibility_policy_popover_content_context( - Number.parseInt(stream_id, 10), - topic_name, - ); instance.setContent( - parse_html(render_change_visibility_policy_popover(instance.context)), + parse_html( + render_change_visibility_policy_popover( + popover_menus_data.get_change_visibility_policy_popover_content_context( + Number.parseInt(stream_id, 10), + topic_name, + ), + ), + ), ); }, onMount(instance) { const $popper = $(instance.popper); - const {stream_id, topic_name} = instance.context; + const $elt = $(instance.reference).closest(".change_visibility_policy").expectOne(); + const stream_id = Number.parseInt($elt.attr("data-stream-id"), 10); + const topic_name = $elt.attr("data-topic-name"); if (!stream_id) { popover_menus.hide_current_popover_if_visible(instance);