forked from github/plane
fix: user profile data mutation (#1243)
This commit is contained in:
parent
e949c4e130
commit
42fceb4dcd
@ -67,7 +67,7 @@ const Profile: NextPage = () => {
|
||||
.then((res) => {
|
||||
mutateUser((prevData) => {
|
||||
if (!prevData) return prevData;
|
||||
return { ...prevData, user: { ...payload, ...res } };
|
||||
return { ...prevData, ...res };
|
||||
}, false);
|
||||
setIsEditing(false);
|
||||
setToastAlert({
|
||||
@ -97,7 +97,7 @@ const Profile: NextPage = () => {
|
||||
if (updateUser)
|
||||
userService
|
||||
.updateUser({ avatar: "" })
|
||||
.then((res) => {
|
||||
.then(() => {
|
||||
setToastAlert({
|
||||
type: "success",
|
||||
title: "Success!",
|
||||
@ -105,7 +105,7 @@ const Profile: NextPage = () => {
|
||||
});
|
||||
mutateUser((prevData) => {
|
||||
if (!prevData) return prevData;
|
||||
return { ...prevData, user: res };
|
||||
return { ...prevData, avatar: "" };
|
||||
}, false);
|
||||
})
|
||||
.catch(() => {
|
||||
|
@ -191,8 +191,8 @@ const WorkspaceSettings: NextPage = () => {
|
||||
<div className="relative mx-auto flex h-12 w-12">
|
||||
<img
|
||||
src={watch("logo")!}
|
||||
alt="Workspace Logo"
|
||||
className="absolute top-0 left-0 h-full w-full object-cover rounded-md"
|
||||
alt="Workspace Logo"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
|
Loading…
Reference in New Issue
Block a user