aboutsummaryrefslogtreecommitdiff
path: root/src/components/status/status.js
diff options
context:
space:
mode:
authordave <starpumadev@gmail.com>2019-04-07 11:38:16 -0400
committertaehoon <th.dev91@gmail.com>2019-05-15 12:04:24 -0400
commit5ab0e71500071d3a760f1a67258d10c564b4425e (patch)
tree8e7b357899348c08e79da2bf3419fb97d3e57622 /src/components/status/status.js
parentdf207593e9ff4826adf0cf25d01b1471b2e0834c (diff)
#468 - show pin status API error
Diffstat (limited to 'src/components/status/status.js')
-rw-r--r--src/components/status/status.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js
index f2881742..39a1b236 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -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 () {