fix user background upload fail + display them
This commit is contained in:
parent
e9b125a6a1
commit
7e2dd215e4
3 changed files with 38 additions and 1 deletions
13
src/App.scss
13
src/App.scss
|
|
@ -787,6 +787,19 @@ option {
|
||||||
padding: 0 0.25em;
|
padding: 0 0.25em;
|
||||||
border-radius: var(--roundness);
|
border-radius: var(--roundness);
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
|
|
||||||
|
&.-dismissible {
|
||||||
|
display: flex;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
margin: 0;
|
||||||
|
align-items: baseline;
|
||||||
|
line-height: 2;
|
||||||
|
|
||||||
|
span {
|
||||||
|
display: block;
|
||||||
|
flex: 1 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.faint {
|
.faint {
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ const AppearanceTab = {
|
||||||
})),
|
})),
|
||||||
backgroundUploading: false,
|
backgroundUploading: false,
|
||||||
background: null,
|
background: null,
|
||||||
|
backgroundError: null,
|
||||||
backgroundPreview: null,
|
backgroundPreview: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -474,6 +475,9 @@ const AppearanceTab = {
|
||||||
resetUploadedBackground() {
|
resetUploadedBackground() {
|
||||||
this.backgroundPreview = null
|
this.backgroundPreview = null
|
||||||
},
|
},
|
||||||
|
clearBackgroundError() {
|
||||||
|
this.backgroundError = null
|
||||||
|
},
|
||||||
submitBackground(background) {
|
submitBackground(background) {
|
||||||
if (!this.backgroundPreview && background !== '') {
|
if (!this.backgroundPreview && background !== '') {
|
||||||
return
|
return
|
||||||
|
|
@ -486,8 +490,11 @@ const AppearanceTab = {
|
||||||
this.$store.commit('addNewUsers', [data])
|
this.$store.commit('addNewUsers', [data])
|
||||||
this.$store.commit('setCurrentUser', data)
|
this.$store.commit('setCurrentUser', data)
|
||||||
this.backgroundPreview = null
|
this.backgroundPreview = null
|
||||||
|
this.backgroundError = null
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
this.backgroundError = e
|
||||||
})
|
})
|
||||||
.catch(this.displayUploadError)
|
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.backgroundUploading = false
|
this.backgroundUploading = false
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -208,6 +208,23 @@
|
||||||
{{ $t('settings.reset') }}
|
{{ $t('settings.reset') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="backgroundError"
|
||||||
|
class="alert error -dismissible"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
{{ backgroundError }}
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
class="button-unstyled"
|
||||||
|
@click="clearBackgroundError"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="times"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<button
|
<button
|
||||||
v-if="!isDefaultBackground"
|
v-if="!isDefaultBackground"
|
||||||
class="btn button-default reset-button"
|
class="btn button-default reset-button"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue