Skip to content

Commit 424c213

Browse files
authored
Merge pull request #318 from fiji-flo/fix-avatar-removal
fix avatar editing again
2 parents c0400a7 + 6746a3e commit 424c213

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/components/profile/edit/EditPictureModal.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<button
2121
type="button"
2222
class="button button--secondary"
23-
:disabled="imgSrc === null"
23+
:disabled="deleteDisabled"
2424
@click="deleteImg"
2525
>
2626
Delete Photo
@@ -124,6 +124,17 @@ export default {
124124
}
125125
},
126126
},
127+
computed: {
128+
deleteDisabled() {
129+
const isEmptyPicture =
130+
this.picture &&
131+
(this.picture.value.startsWith('default:') ||
132+
this.picture.value === null ||
133+
this.picture.value === '' ||
134+
this.picture.value.startsWith('https://s3.amazonaws.com/'));
135+
return isEmptyPicture && this.imgSrc === null;
136+
},
137+
},
127138
};
128139
</script>
129140

0 commit comments

Comments
 (0)