user_pill: Show deactivated icon in user_display_only_pill.

This commit adds code to show the deactivated icon for
deactivated users.
This commit is contained in:
Sahil Batra
2024-07-16 15:41:19 +05:30
committed by Tim Abbott
parent dd0d482d76
commit f937669ba1
8 changed files with 29 additions and 7 deletions

View File

@@ -181,12 +181,15 @@ export function get_sub_by_id(stream_id: number): StreamSubscription | undefined
return stream_info.get(stream_id);
}
export function maybe_get_creator_details(creator_id: number | null): User | undefined {
export function maybe_get_creator_details(
creator_id: number | null,
): (User & {is_active: boolean}) | undefined {
if (creator_id === null) {
return undefined;
}
return people.get_user_by_id_assert_valid(creator_id);
const creator = people.get_user_by_id_assert_valid(creator_id);
return {...creator, is_active: people.is_person_active(creator_id)};
}
export function get_stream_id(name: string): number | undefined {