diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-03-02 08:35:57 +0200 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-03-02 08:35:57 +0200 |
| commit | ab4005add57f36cc78b774971f9942c5894362dc (patch) | |
| tree | 8d7e5d54d839df53187553e6fe379b23a33c059f /src/components | |
| parent | 57e72b48c1fec74a860fd5abc75f0e9c4986c3f6 (diff) | |
add status unavailable message when status can't be loaded in status preview
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/status_popover/status_popover.js | 7 | ||||
| -rw-r--r-- | src/components/status_popover/status_popover.vue | 10 |
2 files changed, 15 insertions, 2 deletions
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 @@ -18,8 +18,14 @@ :compact="true" /> <div + v-else-if="error" + class="status-preview-no-content faint" + > + {{ $t('status.status_unavailable') }} + </div> + <div v-else - class="status-preview-loading" + class="status-preview-no-content" > <i class="icon-spin4 animate-spin" /> </div> @@ -50,7 +56,7 @@ border: none; } - .status-preview-loading { + .status-preview-no-content { padding: 1em; text-align: center; |
