From 05d74a367c3f49a2ccb690b4d121c22c1c264225 Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Wed, 15 May 2024 08:36:09 +0530 Subject: [PATCH] invite: Fix invite modal bug for users who can't subscribe others. The bug was due to the element being accessed when not present in the DOM. This function fixes it by calling the function to setup streams UI only when the concerned elements are present in DOM, i.e. when user can subscribe others. The bug was introduced in 016917679ed. --- web/src/invite.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/invite.ts b/web/src/invite.ts index 7bd784606d..24e0b0765e 100644 --- a/web/src/invite.ts +++ b/web/src/invite.ts @@ -364,7 +364,10 @@ function open_invite_user_modal(e: JQuery.ClickEvent): void set_custom_time_inputs_visibility(); set_expires_on_text(); - set_streams_to_join_list_visibility(); + + if (settings_data.user_can_subscribe_other_users()) { + set_streams_to_join_list_visibility(); + } $("#invite-user-modal").on("click", ".setup-tips-container .banner_content a", () => { dialog_widget.close();