fix: username will not show undefined on cancel or delete (#2982)

pull/2984/head
Brandon Cohen 2 years ago committed by GitHub
parent c4aa08f5f0
commit b925857dfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -183,7 +183,7 @@ const UserList = () => {
autoDismiss: true,
appearance: 'success',
});
setDeleteModal({ isOpen: false });
setDeleteModal({ isOpen: false, user: deleteModal.user });
} catch (e) {
addToast(intl.formatMessage(messages.userdeleteerror), {
autoDismiss: true,
@ -246,9 +246,11 @@ const UserList = () => {
}
okDisabled={isDeleting}
okButtonType="danger"
onCancel={() => setDeleteModal({ isOpen: false })}
onCancel={() =>
setDeleteModal({ isOpen: false, user: deleteModal.user })
}
title={intl.formatMessage(messages.deleteuser, {
username: `${deleteModal.user?.username}`,
username: `${deleteModal.user?.displayName}`,
})}
iconSvg={<TrashIcon />}
>

Loading…
Cancel
Save