mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +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;
 | 
			
		||||
    is_admin: boolean;
 | 
			
		||||
    is_billing_admin: boolean;
 | 
			
		||||
    is_bot: boolean;
 | 
			
		||||
    is_guest: boolean;
 | 
			
		||||
    is_moderator: 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 {
 | 
			
		||||
    if (!page_params.is_owner || page_params.is_bot) {
 | 
			
		||||
    if (!page_params.is_owner) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    let active_owners = 0;
 | 
			
		||||
    for (const person of active_user_dict.values()) {
 | 
			
		||||
        if (person.is_owner && !person.is_bot) {
 | 
			
		||||
            active_owners += 1;
 | 
			
		||||
        }
 | 
			
		||||
        if (active_owners > 1) {
 | 
			
		||||
        if (person.is_owner && !person.is_bot && person.user_id !== my_user_id) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user