aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_settings/user_settings.js
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-02-08 21:59:33 -0500
committertaehoon <th.dev91@gmail.com>2019-02-15 13:34:33 -0500
commitb24db12e1cc318e862169355a22f051d3ea2e809 (patch)
treedb9d78f23932b58d1b00f68254245000eb56beeb /src/components/user_settings/user_settings.js
parent546ba9eba98041ef1c097541a734c73c4917070e (diff)
Make embedded image cropper
Diffstat (limited to 'src/components/user_settings/user_settings.js')
-rw-r--r--src/components/user_settings/user_settings.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index 8987c691..2d521c14 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -21,13 +21,12 @@ const UserSettings = {
followImportError: false,
followsImported: false,
enableFollowsExport: true,
- avatarUploading: false,
+ pickAvatarBtnVisible: true,
bannerUploading: false,
backgroundUploading: false,
followListUploading: false,
bannerPreview: null,
backgroundPreview: null,
- avatarUploadError: null,
bannerUploadError: null,
backgroundUploadError: null,
deletingAccount: false,
@@ -120,15 +119,13 @@ const UserSettings = {
},
submitAvatar (cropper) {
const img = cropper.getCroppedCanvas({ minWidth: 150, minHeight: 150 }).toDataURL('image/jpeg')
- this.avatarUploading = true
- this.$store.state.api.backendInteractor.updateAvatar({ params: { img } }).then((user) => {
+ return this.$store.state.api.backendInteractor.updateAvatar({ params: { img } }).then((user) => {
if (!user.error) {
this.$store.commit('addNewUsers', [user])
this.$store.commit('setCurrentUser', user)
} else {
- this.avatarUploadError = this.$t('upload.error.base') + user.error
+ throw this.$t('upload.error.base') + user.error
}
- this.avatarUploading = false
})
},
clearUploadError (slot) {