mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
people: Don’t reference nonexistent page_params.is_bot.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
9703b4d70b
commit
a5d51a0895
@@ -27,7 +27,6 @@ export const page_params: {
|
|||||||
furthest_read_time: number | null;
|
furthest_read_time: number | null;
|
||||||
is_admin: boolean;
|
is_admin: boolean;
|
||||||
is_billing_admin: boolean;
|
is_billing_admin: boolean;
|
||||||
is_bot: boolean;
|
|
||||||
is_guest: boolean;
|
is_guest: boolean;
|
||||||
is_moderator: boolean;
|
is_moderator: boolean;
|
||||||
is_owner: boolean;
|
is_owner: boolean;
|
||||||
|
|||||||
@@ -978,16 +978,12 @@ export function is_active_user_for_popover(user_id: number): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function is_current_user_only_owner(): boolean {
|
export function is_current_user_only_owner(): boolean {
|
||||||
if (!page_params.is_owner || page_params.is_bot) {
|
if (!page_params.is_owner) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let active_owners = 0;
|
|
||||||
for (const person of active_user_dict.values()) {
|
for (const person of active_user_dict.values()) {
|
||||||
if (person.is_owner && !person.is_bot) {
|
if (person.is_owner && !person.is_bot && person.user_id !== my_user_id) {
|
||||||
active_owners += 1;
|
|
||||||
}
|
|
||||||
if (active_owners > 1) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user