diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-12-26 16:49:42 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-12-26 16:49:42 +0000 |
| commit | b8f4b18ae5e362bce97553cf4bcde1749b6fea32 (patch) | |
| tree | b9e370f0af483e569c4bdd374d91cd140022174c /src/components/settings/settings.js | |
| parent | f7029a27eb9def00c80929b2c2cfb1d22d29bbfe (diff) | |
| parent | bd07e5de1c03a5619db5af49f14dc20602134881 (diff) | |
Merge branch 'streaming' into 'develop'
Streaming and Backend Interactor service overhaul, removed the need for copypasting
See merge request pleroma/pleroma-fe!1012
Diffstat (limited to 'src/components/settings/settings.js')
| -rw-r--r-- | src/components/settings/settings.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index c49083f9..31a9e9be 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -84,7 +84,7 @@ const settings = { } }]) .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}), - // Special cases (need to transform values) + // Special cases (need to transform values or perform actions first) muteWordsString: { get () { return this.$store.getters.mergedConfig.muteWords.join('\n') }, set (value) { @@ -93,6 +93,22 @@ const settings = { value: filter(value.split('\n'), (word) => trim(word).length > 0) }) } + }, + useStreamingApi: { + get () { return this.$store.getters.mergedConfig.useStreamingApi }, + set (value) { + const promise = value + ? this.$store.dispatch('enableMastoSockets') + : this.$store.dispatch('disableMastoSockets') + + promise.then(() => { + this.$store.dispatch('setOption', { name: 'useStreamingApi', value }) + }).catch((e) => { + console.error('Failed starting MastoAPI Streaming socket', e) + this.$store.dispatch('disableMastoSockets') + this.$store.dispatch('setOption', { name: 'useStreamingApi', value: false }) + }) + } } }, // Updating nested properties |
