mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
invites: Live update option to create new invitations.
Earlier option to create new invitations in right_sidebar, gear_menu and invitations panel does not get live update when the setting `who can invite others to realm` is changed. This commit make changes to do live update.
This commit is contained in:
@@ -189,13 +189,21 @@ function initialize_left_sidebar() {
|
||||
$("#left-sidebar-container").html(rendered_sidebar);
|
||||
}
|
||||
|
||||
export function update_invite_user_option() {
|
||||
if (!settings_data.user_can_invite_others_to_realm()) {
|
||||
$("#right-sidebar .invite-user-link").hide();
|
||||
} else {
|
||||
$("#right-sidebar .invite-user-link").show();
|
||||
}
|
||||
}
|
||||
|
||||
function initialize_right_sidebar() {
|
||||
const rendered_sidebar = render_right_sidebar({
|
||||
can_invite_others_to_realm: settings_data.user_can_invite_others_to_realm(),
|
||||
realm_rendered_description: page_params.realm_rendered_description,
|
||||
});
|
||||
|
||||
$("#right-sidebar-container").html(rendered_sidebar);
|
||||
update_invite_user_option();
|
||||
if (page_params.is_spectator) {
|
||||
rendered_markdown.update_elements(
|
||||
$(".right-sidebar .realm-description .rendered_markdown"),
|
||||
|
||||
Reference in New Issue
Block a user