mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 06:48:21 +00:00
show toast on renaming first/last name to empty string (#1328)
This commit is contained in:
parent
5c17d64463
commit
1aca2b0ea0
1 changed files with 7 additions and 0 deletions
|
|
@ -14,6 +14,13 @@ function SettingsPage(props) {
|
|||
const [passwordChangeInProgress, setPasswordChangeInProgress] = React.useState(false);
|
||||
|
||||
const updateDetails = async () => {
|
||||
if (!firstName || !lastName) {
|
||||
toast.warn("Name can't be empty!", {
|
||||
hideProgressBar: true,
|
||||
position: 'top-left',
|
||||
});
|
||||
return;
|
||||
}
|
||||
setUpdateInProgress(true);
|
||||
const updatedDetails = await userService.updateCurrentUser(firstName, lastName);
|
||||
authenticationService.updateCurrentUserDetails(updatedDetails);
|
||||
|
|
|
|||
Loading…
Reference in a new issue