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

Loading…
Cancel
Save