feat(settings): confirmations in the shared dialog, token colours on About, scope picker in the new look

This commit is contained in:
Maurice
2026-10-01 16:19:41 +02:00
parent 56dfd56bab
commit cf3818cb66
17 changed files with 337 additions and 191 deletions
+4 -2
View File
@@ -492,12 +492,14 @@ export function useAdmin() {
}
}
const handleDeleteUser = async (user) => {
// `confirmed` means the caller already asked in its own ConfirmDialog (the
// desktop users tab); without it the browser's confirm asks, as on mobile.
const handleDeleteUser = async (user, opts: { confirmed?: boolean } = {}) => {
if (user.id === currentUser?.id) {
toast.error(t('admin.toast.cannotDeleteSelf'))
return
}
if (!confirm(t('admin.deleteUser', { name: user.username }))) return
if (!opts.confirmed && !confirm(t('admin.deleteUser', { name: user.username }))) return
try {
await adminApi.deleteUser(user.id)
setUsers(prev => prev.filter(u => u.id !== user.id))