Skip to content

Commit

Permalink
Merge pull request #420 from ita-social-projects/#419-FixNotification…
Browse files Browse the repository at this point in the history
…AboutUnsavedChanges

#419 [Edit Profile] Fix notification about unsaved changes
  • Loading branch information
Lvyshnevska authored Feb 6, 2024
2 parents 7105e6c + a908554 commit 300a6d3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,13 @@ const GeneralInfo = (props) => {
profileMutate((prevState) => {
return { ...prevState, [imageKey]: data[imageKey] };
});
setProfile((prevState) => {
return { ...prevState, [imageKey]: data[imageKey] };
});
if (imageKey === 'banner_image') {
setBannerImage(mainProfile.banner_image);
setBannerImage(data.banner_image);
} else {
setLogoImage(mainProfile.logo_image);
setLogoImage(data.logo_image);
}
data[imageKey] === null
? toast.success(imageKey === 'banner_image' ? 'Банер видалено з профілю' : 'Логотип видалено з профілю')
Expand Down

0 comments on commit 300a6d3

Please sign in to comment.