Commit 5ab0e715 authored by Dave LiPuma's avatar Dave LiPuma Committed by Tae Hoon

#468 - show pin status API error

parent df207593
......@@ -38,6 +38,7 @@ const Status = {
showPreview: false,
showingTall: this.inConversation && this.focused,
showingLongSubject: false,
error: null,
expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined'
? !this.$store.state.instance.collapseMessageWithSubject
: !this.$store.state.config.collapseMessageWithSubject,
......@@ -359,7 +360,12 @@ const Status = {
},
pinStatus () {
this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => {
this.$store.dispatch('updatePinned', status)
if (status.error) {
this.error = status.error
setTimeout(() => this.error = null, 5000)
} else {
this.$store.dispatch('updatePinned', status)
}
})
},
unpinStatus () {
......
<template>
<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">
<div class="media status container muted">
<small>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment