diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2024-04-22 19:23:52 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2024-04-22 19:23:52 +0000 |
| commit | 2cbfcb6a6deac223d110b4190b0415cd837f7299 (patch) | |
| tree | 1004b4bb172fd4fa424dc231469f3d7fda4e50d2 /src | |
| parent | e853d746b0d8868dd1f586f801865c651948401d (diff) | |
| parent | b173741f870243c6ded3b6f400827f8c00f20bb7 (diff) | |
Merge branch 'tusooa/status-loading-indicator' into 'develop'
Display loading and error indicator for conversation page
See merge request pleroma/pleroma-fe!1907
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/conversation/conversation.js | 7 | ||||
| -rw-r--r-- | src/components/conversation/conversation.vue | 17 | ||||
| -rw-r--r-- | src/i18n/en.json | 4 |
3 files changed, 26 insertions, 2 deletions
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 85e6d8ad..a94d2130 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -56,7 +56,8 @@ const conversation = { expanded: false, threadDisplayStatusObject: {}, // id => 'showing' | 'hidden' statusContentPropertiesObject: {}, - inlineDivePosition: null + inlineDivePosition: null, + loadStatusError: null } }, props: [ @@ -392,11 +393,15 @@ const conversation = { this.setHighlight(this.originalStatusId) }) } else { + this.loadStatusError = null this.$store.state.api.backendInteractor.fetchStatus({ id: this.statusId }) .then((status) => { this.$store.dispatch('addNewStatuses', { statuses: [status] }) this.fetchConversation() }) + .catch((error) => { + this.loadStatusError = error + }) } }, getReplies (id) { diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 171e6717..526de5c3 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -29,6 +29,23 @@ /> </div> <div + v-if="isPage && !status" + class="conversation-body" + :class="{ 'panel-body': isExpanded }" + > + <p v-if="!loadStatusError"> + <FAIcon + spin + icon="circle-notch" + /> + {{ $t('status.loading') }} + </p> + <p v-else> + {{ $t('status.load_error', { error: loadStatusError }) }} + </p> + </div> + <div + v-else class="conversation-body" :class="{ 'panel-body': isExpanded }" > diff --git a/src/i18n/en.json b/src/i18n/en.json index 8b7d6021..a011139a 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -1110,7 +1110,9 @@ "hide_quote": "Hide the quoted status", "display_quote": "Display the quoted status", "invisible_quote": "Quoted status unavailable: {link}", - "more_actions": "More actions on this status" + "more_actions": "More actions on this status", + "loading": "Loading...", + "load_error": "Unable to load status: {error}" }, "user_card": { "approve": "Approve", |
