1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-01-30 17:15:16 +01:00

refs #921 Allow switching streaming only dm, local, public, tag, and list

This commit is contained in:
AkiraFukushima 2019-06-27 22:08:21 +09:00
parent 97b05e78c5
commit 1b5c9cee32

View File

@ -5,7 +5,13 @@
</div>
<div class="tools">
<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
:class="useWebsocket ? 'websocket' : 'not-websocket'"
width="25"
@ -151,6 +157,18 @@ export default {
break
}
},
streamingSwitchable() {
switch (this.$route.name) {
case 'direct-messages':
case 'local':
case 'public':
case 'tag':
case 'list':
return !this.pleroma
default:
return false
}
},
switchStreaming() {
this.$store.dispatch('TimelineSpace/stopStreamings')
this.$store.commit('TimelineSpace/changeUseWebsocket', !this.useWebsocket)