diff options
| author | tusooa <tusooa@kazv.moe> | 2022-09-11 18:08:00 +0000 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2022-09-11 18:08:00 +0000 |
| commit | 2bea5d81288dcf4e231d557b5f1ef338fc1f78f6 (patch) | |
| tree | 67515a1ae88f74a88763a5e769a49ce6715ba73f /src/components/conversation/conversation.js | |
| parent | de40ebd5ea9c3a89c85d822ee719dce9b48c451a (diff) | |
| parent | ee58e3868c2d58b889d8a32c1b6dfd3732df7584 (diff) | |
Merge branch 'add/edit-status' into 'develop'
Add edit status functionality
See merge request pleroma/pleroma-fe!1537
Diffstat (limited to 'src/components/conversation/conversation.js')
| -rw-r--r-- | src/components/conversation/conversation.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 712e2a2c..85e6d8ad 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -1,6 +1,8 @@ import { reduce, filter, findIndex, clone, get } from 'lodash' import Status from '../status/status.vue' import ThreadTree from '../thread_tree/thread_tree.vue' +import { WSConnectionStatus } from '../../services/api/api.service.js' +import { mapGetters, mapState } from 'vuex' import QuickFilterSettings from '../quick_filter_settings/quick_filter_settings.vue' import QuickViewSettings from '../quick_view_settings/quick_view_settings.vue' @@ -79,6 +81,9 @@ const conversation = { const maxDepth = this.$store.getters.mergedConfig.maxDepthInThread - 2 return maxDepth >= 1 ? maxDepth : 1 }, + streamingEnabled () { + return this.mergedConfig.useStreamingApi && this.mastoUserSocketStatus === WSConnectionStatus.JOINED + }, displayStyle () { return this.$store.getters.mergedConfig.conversationDisplay }, @@ -341,7 +346,11 @@ const conversation = { }, maybeHighlight () { return this.isExpanded ? this.highlight : null - } + }, + ...mapGetters(['mergedConfig']), + ...mapState({ + mastoUserSocketStatus: state => state.api.mastoUserSocketStatus + }) }, components: { Status, @@ -399,6 +408,11 @@ const conversation = { setHighlight (id) { if (!id) return this.highlight = id + + if (!this.streamingEnabled) { + this.$store.dispatch('fetchStatus', id) + } + this.$store.dispatch('fetchFavsAndRepeats', id) this.$store.dispatch('fetchEmojiReactionsBy', id) }, |
