logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe
commit: dbcd8294e80a26fb4156de6825970f75bb6a1dfd
parent: 57e72b48c1fec74a860fd5abc75f0e9c4986c3f6
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date:   Mon,  2 Mar 2020 10:49:24 +0000

Merge branch 'fix/remove-spinner-on-failed-status-previews' into 'develop'

Fix: failed status previews spinning forever

See merge request pleroma/pleroma-fe!1078

Diffstat:

Msrc/components/status_popover/status_popover.js7+++++++
Msrc/components/status_popover/status_popover.vue10++++++++--
Msrc/i18n/en.json3++-
Msrc/i18n/fi.json3++-
Msrc/modules/statuses.js2+-
5 files changed, 20 insertions(+), 5 deletions(-)

diff --git 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 @@ -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; diff --git a/src/i18n/en.json b/src/i18n/en.json @@ -615,7 +615,8 @@ "reply_to": "Reply to", "replies_list": "Replies:", "mute_conversation": "Mute conversation", - "unmute_conversation": "Unmute conversation" + "unmute_conversation": "Unmute conversation", + "status_unavailable": "Status unavailable" }, "user_card": { "approve": "Approve", diff --git a/src/i18n/fi.json b/src/i18n/fi.json @@ -289,7 +289,8 @@ "reply_to": "Vastaus", "replies_list": "Vastaukset:", "mute_conversation": "Hiljennä keskustelu", - "unmute_conversation": "Poista hiljennys" + "unmute_conversation": "Poista hiljennys", + "status_unavailable": "Viesti ei saatavissa" }, "user_card": { "approve": "Hyväksy", diff --git a/src/modules/statuses.js b/src/modules/statuses.js @@ -616,7 +616,7 @@ const statuses = { commit('setNotificationsSilence', { value }) }, fetchStatus ({ rootState, dispatch }, id) { - rootState.api.backendInteractor.fetchStatus({ id }) + return rootState.api.backendInteractor.fetchStatus({ id }) .then((status) => dispatch('addNewStatuses', { statuses: [status] })) }, deleteStatus ({ rootState, commit }, status) {