diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 68b90c72..c1cb4ab6 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -50,6 +50,7 @@ const sortAndFilterConversation = (conversation, statusoid) => { const conversation = { data () { return { + error: false, highlight: null, expanded: false, threadDisplayStatusObject: {}, // id => 'showing' | 'hidden' @@ -380,6 +381,14 @@ const conversation = { }, methods: { fetchConversation () { + this.error = false + const displayError = (reason) => { + if (this.$store.state.users.currentUser) { + this.error = reason + } else { + this.error = this.$t('timeline.unauthorized') + } + } if (this.status) { this.$store.state.api.backendInteractor.fetchConversation({ id: this.statusId }) .then(({ ancestors, descendants }) => { @@ -387,12 +396,14 @@ const conversation = { this.$store.dispatch('addNewStatuses', { statuses: descendants }) this.setHighlight(this.originalStatusId) }) + .catch(displayError) } else { this.$store.state.api.backendInteractor.fetchStatus({ id: this.statusId }) .then((status) => { this.$store.dispatch('addNewStatuses', { statuses: [status] }) this.fetchConversation() }) + .catch(displayError) } }, getReplies (id) { diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 61f1358a..9b8c0b3e 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -18,7 +18,21 @@ {{ $t('timeline.collapse') }} -