Skip to content

Commit c0400a7

Browse files
authored
Merge pull request #316 from fiji-flo/fix-avatar-removal
fix avatar editing
2 parents 96d265a + c2ad4e9 commit c0400a7

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

src/components/profile/edit/EditPersonalInfo.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
>
1818
<EditPictureModal
1919
v-if="showPictureModal"
20-
v-bind="{ picture, username: loggedInUser, staffInformation }"
20+
v-bind="{
21+
picture,
22+
username: loggedInUser.primaryUsername,
23+
staffInformation,
24+
}"
2125
@close="showPictureModal = false"
2226
/>
2327
<header class="profile__section-header" ref="header" tabindex="-1">

src/components/profile/edit/EditPictureModal.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
@change="handleChangeFile"
1818
/>
1919
</label>
20-
<button type="button" class="button button--secondary" @click="deleteImg">
20+
<button
21+
type="button"
22+
class="button button--secondary"
23+
:disabled="imgSrc === null"
24+
@click="deleteImg"
25+
>
2126
Delete Photo
2227
</button>
2328
</div>
@@ -88,7 +93,7 @@ export default {
8893
methods: {
8994
async deleteImg() {
9095
this.picture.value = '';
91-
this.$emit('close');
96+
this.imgSrc = null;
9297
},
9398
handleChangeFile(event) {
9499
loadImage(
@@ -110,7 +115,7 @@ export default {
110115
);
111116
},
112117
selectCrop() {
113-
if (this.$refs.crop && !this.imgSrc) {
118+
if (this.$refs.crop && this.imgSrc !== null) {
114119
const data = this.$refs.crop.cropper.toDataURL();
115120
this.resize(data);
116121
} else {

0 commit comments

Comments
 (0)