Added checks for deleteImage
This commit is contained in:
1 parent
95fc67c900
commit
40caf87900
1 file changed
+21
-2
@@ -128,6 +128,8 @@ const ProfilePanel = () => {
|
|||||||
setProgress({ value: 0, isLoading: false });
|
setProgress({ value: 0, isLoading: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log(localData);
|
||||||
|
|
||||||
// Closes the picture update modal and resets related states
|
// Closes the picture update modal and resets related states
|
||||||
const closePictureModal = () => {
|
const closePictureModal = () => {
|
||||||
// removePicture();
|
// removePicture();
|
||||||
@@ -261,7 +263,16 @@ const ProfilePanel = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack className="row-stack" direction="row" alignItems="center">
|
<Stack className="row-stack" direction="row" alignItems="center">
|
||||||
<Avatar src={file?.src} sx={{ mr: "8px" }} />
|
<Avatar
|
||||||
|
src={
|
||||||
|
localData?.deleteProfileImage
|
||||||
|
? "/static/images/avatar/2.jpg"
|
||||||
|
: file?.src
|
||||||
|
? file.src
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
sx={{ mr: "8px" }}
|
||||||
|
/>
|
||||||
<Button
|
<Button
|
||||||
level="tertiary"
|
level="tertiary"
|
||||||
label="Delete"
|
label="Delete"
|
||||||
@@ -397,7 +408,15 @@ const ProfilePanel = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<ImageField
|
<ImageField
|
||||||
id="update-profile-picture"
|
id="update-profile-picture"
|
||||||
src={file?.src}
|
src={
|
||||||
|
localData?.deleteProfileImage
|
||||||
|
? ""
|
||||||
|
: file?.src
|
||||||
|
? file.src
|
||||||
|
: user?.avatarImage
|
||||||
|
? `data:image/png;base64,${user.avatarImage}`
|
||||||
|
: ""
|
||||||
|
}
|
||||||
loading={progress.isLoading && progress.value !== 100}
|
loading={progress.isLoading && progress.value !== 100}
|
||||||
onChange={handlePicture}
|
onChange={handlePicture}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user