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 016917679e.
This commit is contained in:
Sahil Batra 2024-05-15 08:36:09 +05:30 committed by Tim Abbott
parent a85eb2110d
commit 05d74a367c
1 changed files with 4 additions and 1 deletions

View File

@ -364,7 +364,10 @@ function open_invite_user_modal(e: JQuery.ClickEvent<Document, undefined>): 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();