1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Update dialog title to show user to be deleted

This commit is contained in:
Chris Hill 2023-11-05 23:15:02 +00:00 committed by Bill Thornton
parent e7d9e8c737
commit 150964a2e6
5 changed files with 11 additions and 6 deletions

View file

@ -49,6 +49,7 @@ const UserProfiles: FunctionComponent = () => {
const showUserMenu = (elem: HTMLElement) => {
const card = dom.parentWithClass(elem, 'card');
const userId = card?.getAttribute('data-userid');
const username = card?.getAttribute('data-username');
if (!userId) {
console.error('Unexpected null user id');
@ -106,7 +107,7 @@ const UserProfiles: FunctionComponent = () => {
break;
case 'delete':
deleteUser(userId);
deleteUser(userId, username);
}
}
}).catch(() => {
@ -117,12 +118,13 @@ const UserProfiles: FunctionComponent = () => {
});
};
const deleteUser = (id: string) => {
const msg = globalize.translate('DeleteUserConfirmation');
const deleteUser = (id: string, username?: string | null) => {
const title = username ? globalize.translate('DeleteName', username) : globalize.translate('DeleteUser');
const text = globalize.translate('DeleteUserConfirmation');
confirm({
title: globalize.translate('DeleteUser'),
text: msg,
title,
text,
confirmText: globalize.translate('Delete'),
primary: 'delete'
}).then(function () {