diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-01-15 12:13:06 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-01-15 12:13:06 +0100 |
commit | 38c8050409cf9c2f3799998898416fe5bdcce29d (patch) | |
tree | ba9335d43d5e9053e84bdadb491d35e87a7bd63f | |
parent | 77aa4bbdf448ec1d054f3883cbf09b0065db50c8 (diff) |
Reset input and avatar file check
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r-- | src/components/ContactDetails/ContactDetailsAvatar.vue | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/components/ContactDetails/ContactDetailsAvatar.vue b/src/components/ContactDetails/ContactDetailsAvatar.vue index 05273434..8afa46d2 100644 --- a/src/components/ContactDetails/ContactDetailsAvatar.vue +++ b/src/components/ContactDetails/ContactDetailsAvatar.vue @@ -76,7 +76,7 @@ export default { processFile(event) { if (event.target.files) { let file = event.target.files[0] - if (file.size && file.size <= 1 * 1024 * 1024) { + if (file && file.size && file.size <= 1 * 1024 * 1024) { let reader = new FileReader() let self = this // check if photo property exists to decide whether to add/update it @@ -90,6 +90,8 @@ export default { reader.readAsDataURL(file) } else { OC.Notification.showTemporary(t('contacts', 'Image is too big (max 1MB).')) + // reset input + event.target.value = '' } } }, |