From 5ab0e71500071d3a760f1a67258d10c564b4425e Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 7 Apr 2019 11:38:16 -0400 Subject: [PATCH] #468 - show pin status API error --- src/components/status/status.js | 8 +++++++- src/components/status/status.vue | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) 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 () { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index ca5e4a1c..d55f3d95 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -1,5 +1,6 @@