-
-
![]()
-
+
+
+
-
@@ -31,9 +35,8 @@
}
}
- &-btn {
- display: block;
- width: 100%;
+ &-buttons-wrapper {
+ margin-top: 15px;
}
}
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) {
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index 9fcd3752..8ab92e95 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -47,20 +47,11 @@
{{$t('settings.avatar')}}
{{$t('settings.avatar_size_instruction')}}
-
-
-
![]()
-
-
-
-
-
-
-
- Error: {{ avatarUploadError }}
-
-
-
+
{{$t('settings.current_avatar')}}
+
![]()
+
{{$t('settings.set_new_avatar')}}
+
+
{{$t('settings.profile_banner')}}
@@ -196,29 +187,7 @@
max-width: 100%;
}
- .avatar-upload {
- display: inline-block;
- position: relative;
- }
-
- .avatar-upload-loading-wrapper {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- background: rgba(0,0,0,.3);
-
- i {
- font-size: 50px;
- color: #FFF;
- }
- }
-
- .avatar {
+ .current-avatar {
display: block;
width: 150px;
height: 150px;
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 3e9ac157..af62acfc 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -23,7 +23,8 @@
},
"image_cropper": {
"crop_picture": "Crop picture",
- "save": "Save"
+ "save": "Save",
+ "cancel": "Cancel"
},
"login": {
"login": "Log in",
@@ -116,7 +117,6 @@
"collapse_subject": "Collapse posts with subjects",
"composing": "Composing",
"confirm_new_password": "Confirm new password",
- "crop_your_new_avatar": "Crop your new avatar",
"current_avatar": "Your current avatar",
"current_password": "Current password",
"current_profile_banner": "Your current profile banner",
@@ -211,6 +211,7 @@
"theme_help_v2_1": "You can also override certain component's colors and opacity by toggling the checkbox, use \"Clear all\" button to clear all overrides.",
"theme_help_v2_2": "Icons underneath some entries are background/text contrast indicators, hover over for detailed info. Please keep in mind that when using transparency contrast indicators show the worst possible case.",
"tooltipRadius": "Tooltips/alerts",
+ "upload_a_photo": "Upload a photo",
"user_settings": "User Settings",
"values": {
"false": "no",
--
cgit v1.2.3-70-g09d2
From 2132d58075c71bd8a445288d052cc05e321fdf24 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Fri, 8 Feb 2019 22:06:02 -0500
Subject: Remove cropped image size restriction
---
src/components/user_settings/user_settings.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'src/components/user_settings/user_settings.js')
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index 2d521c14..c1c60102 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -118,7 +118,7 @@ const UserSettings = {
reader.readAsDataURL(file)
},
submitAvatar (cropper) {
- const img = cropper.getCroppedCanvas({ minWidth: 150, minHeight: 150 }).toDataURL('image/jpeg')
+ const img = cropper.getCroppedCanvas().toDataURL('image/jpeg')
return this.$store.state.api.backendInteractor.updateAvatar({ params: { img } }).then((user) => {
if (!user.error) {
this.$store.commit('addNewUsers', [user])
--
cgit v1.2.3-70-g09d2
From 2de756aa0c27ae5267032e07c2e1f998d49d0df5 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Fri, 8 Feb 2019 22:17:53 -0500
Subject: Better error handling
---
src/components/image_cropper/image_cropper.js | 3 +++
src/components/image_cropper/image_cropper.vue | 2 +-
src/components/user_settings/user_settings.js | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
(limited to 'src/components/user_settings/user_settings.js')
diff --git a/src/components/image_cropper/image_cropper.js b/src/components/image_cropper/image_cropper.js
index 4eaa08d4..da94427a 100644
--- a/src/components/image_cropper/image_cropper.js
+++ b/src/components/image_cropper/image_cropper.js
@@ -50,6 +50,9 @@ const ImageCropper = {
},
cancelText () {
return this.cancelButtonLabel || this.$t('image_cropper.cancel')
+ },
+ submitErrorMsg () {
+ return this.submitError && this.submitError instanceof Error ? this.submitError.toString() : this.submitError
}
},
methods: {
diff --git a/src/components/image_cropper/image_cropper.vue b/src/components/image_cropper/image_cropper.vue
index aa895863..24a6f3bd 100644
--- a/src/components/image_cropper/image_cropper.vue
+++ b/src/components/image_cropper/image_cropper.vue
@@ -10,7 +10,7 @@
- Error: {{ submitError }}
+ {{submitErrorMsg}}
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index c1c60102..dce3eeed 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -124,7 +124,7 @@ const UserSettings = {
this.$store.commit('addNewUsers', [user])
this.$store.commit('setCurrentUser', user)
} else {
- throw this.$t('upload.error.base') + user.error
+ throw new Error(this.$t('upload.error.base') + user.error)
}
})
},
--
cgit v1.2.3-70-g09d2
From 63cfe051c7f5419da3942632f3a5453f6cd5c769 Mon Sep 17 00:00:00 2001
From: dave