mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-31 01:27:26 +01:00
refs #921 Allow switching streaming only dm, local, public, tag, and list
This commit is contained in:
parent
97b05e78c5
commit
1b5c9cee32
@ -5,7 +5,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="tools">
|
<div class="tools">
|
||||||
<img src="../../assets/images/loading-spinner-wide.svg" v-show="loading" class="header-loading" />
|
<img src="../../assets/images/loading-spinner-wide.svg" v-show="loading" class="header-loading" />
|
||||||
<el-button v-if="!pleroma" type="text" class="action" @click="switchStreaming" :title="$t('header_menu.switch_streaming')">
|
<el-button
|
||||||
|
v-if="streamingSwitchable()"
|
||||||
|
type="text"
|
||||||
|
class="action"
|
||||||
|
@click="switchStreaming"
|
||||||
|
:title="$t('header_menu.switch_streaming')"
|
||||||
|
>
|
||||||
<svg
|
<svg
|
||||||
:class="useWebsocket ? 'websocket' : 'not-websocket'"
|
:class="useWebsocket ? 'websocket' : 'not-websocket'"
|
||||||
width="25"
|
width="25"
|
||||||
@ -151,6 +157,18 @@ export default {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
streamingSwitchable() {
|
||||||
|
switch (this.$route.name) {
|
||||||
|
case 'direct-messages':
|
||||||
|
case 'local':
|
||||||
|
case 'public':
|
||||||
|
case 'tag':
|
||||||
|
case 'list':
|
||||||
|
return !this.pleroma
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
switchStreaming() {
|
switchStreaming() {
|
||||||
this.$store.dispatch('TimelineSpace/stopStreamings')
|
this.$store.dispatch('TimelineSpace/stopStreamings')
|
||||||
this.$store.commit('TimelineSpace/changeUseWebsocket', !this.useWebsocket)
|
this.$store.commit('TimelineSpace/changeUseWebsocket', !this.useWebsocket)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user