#468 - show pin status API error

This commit is contained in:
dave 2019-04-07 11:38:16 -04:00 committed by taehoon
parent df207593e9
commit 5ab0e71500
2 changed files with 8 additions and 1 deletions

View File

@ -38,6 +38,7 @@ const Status = {
showPreview: false, showPreview: false,
showingTall: this.inConversation && this.focused, showingTall: this.inConversation && this.focused,
showingLongSubject: false, showingLongSubject: false,
error: null,
expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined' expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined'
? !this.$store.state.instance.collapseMessageWithSubject ? !this.$store.state.instance.collapseMessageWithSubject
: !this.$store.state.config.collapseMessageWithSubject, : !this.$store.state.config.collapseMessageWithSubject,
@ -359,7 +360,12 @@ const Status = {
}, },
pinStatus () { pinStatus () {
this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => { this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => {
if (status.error) {
this.error = status.error
setTimeout(() => this.error = null, 5000)
} else {
this.$store.dispatch('updatePinned', status) this.$store.dispatch('updatePinned', status)
}
}) })
}, },
unpinStatus () { unpinStatus () {

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="status-el" v-if="!hideStatus" :class="[{ 'status-el_focused': isFocused }, { 'status-conversation': inlineExpanded }]"> <div class="status-el" v-if="!hideStatus" :class="[{ 'status-el_focused': isFocused }, { 'status-conversation': inlineExpanded }]">
<div v-if="error" class="alert error">{{error}}</div>
<template v-if="muted && !isPreview"> <template v-if="muted && !isPreview">
<div class="media status container muted"> <div class="media status container muted">
<small> <small>