ui_init: Move update_invite_user_option to sidebar_ui.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2023-10-02 14:21:22 -07:00
committed by Tim Abbott
parent 457544e0d2
commit 67f2bc030f
4 changed files with 18 additions and 17 deletions

View File

@@ -149,24 +149,13 @@ function initialize_left_sidebar() {
$("#left-sidebar-container").html(rendered_sidebar);
}
export function update_invite_user_option() {
if (
!settings_data.user_can_invite_users_by_email() &&
!settings_data.user_can_create_multiuse_invite()
) {
$("#right-sidebar .invite-user-link").hide();
} else {
$("#right-sidebar .invite-user-link").show();
}
}
function initialize_right_sidebar() {
const rendered_sidebar = render_right_sidebar({
realm_rendered_description: page_params.realm_rendered_description,
});
$("#right-sidebar-container").html(rendered_sidebar);
update_invite_user_option();
sidebar_ui.update_invite_user_option();
if (page_params.is_spectator) {
rendered_markdown.update_elements(
$(".right-sidebar .realm-description .rendered_markdown"),