summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-01-15 12:13:06 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-01-15 12:13:06 +0100
commit38c8050409cf9c2f3799998898416fe5bdcce29d (patch)
treeba9335d43d5e9053e84bdadb491d35e87a7bd63f
parent77aa4bbdf448ec1d054f3883cbf09b0065db50c8 (diff)
Reset input and avatar file check
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r--src/components/ContactDetails/ContactDetailsAvatar.vue4
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 = ''
}
}
},