From ab4005add57f36cc78b774971f9942c5894362dc Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 2 Mar 2020 08:35:57 +0200 Subject: add status unavailable message when status can't be loaded in status preview --- src/components/status_popover/status_popover.js | 7 +++++++ src/components/status_popover/status_popover.vue | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src/components/status_popover') diff --git a/src/components/status_popover/status_popover.js b/src/components/status_popover/status_popover.js index cb55f67e..159132a9 100644 --- a/src/components/status_popover/status_popover.js +++ b/src/components/status_popover/status_popover.js @@ -5,6 +5,11 @@ const StatusPopover = { props: [ 'statusId' ], + data () { + return { + error: false + } + }, computed: { status () { return find(this.$store.state.statuses.allStatuses, { id: this.statusId }) @@ -18,6 +23,8 @@ const StatusPopover = { enter () { if (!this.status) { this.$store.dispatch('fetchStatus', this.statusId) + .then(data => (this.error = false)) + .catch(e => (this.error = true)) } } } diff --git a/src/components/status_popover/status_popover.vue b/src/components/status_popover/status_popover.vue index 11f6cb5a..f5948207 100644 --- a/src/components/status_popover/status_popover.vue +++ b/src/components/status_popover/status_popover.vue @@ -17,9 +17,15 @@ :statusoid="status" :compact="true" /> +
+ {{ $t('status.status_unavailable') }} +
@@ -50,7 +56,7 @@ border: none; } - .status-preview-loading { + .status-preview-no-content { padding: 1em; text-align: center; -- cgit v1.2.3-70-g09d2