settings_users: Don't use `text()` with undefined value.

`text(undefined)` is a noop, and also isn't validly typed.
This commit is contained in:
evykassirer 2024-11-04 19:51:59 -08:00 committed by Tim Abbott
parent 7fbdefcfc0
commit 0e3374dc1b
1 changed files with 4 additions and 1 deletions

View File

@ -440,7 +440,10 @@ export function update_user_data(user_id, new_data) {
}
if (new_data.role !== undefined) {
$user_row.find(".user_role").text(people.get_user_type(user_id));
const user_type = people.get_user_type(user_id);
if (user_type) {
$user_row.find(".user_role").text(user_type);
}
}
}