fix: Stop unbind events when reload, and call unbind when destroy

This commit is contained in:
AkiraFukushima 2018-11-17 21:03:56 +09:00
parent 09f063ca17
commit 76d133f5b4
3 changed files with 5 additions and 2 deletions

View File

@ -73,6 +73,7 @@ export default {
window.removeEventListener('dragover', this.onDragOver)
window.removeEventListener('drop', this.handleDrop)
this.$store.dispatch('TimelineSpace/stopStreamings')
this.$store.dispatch('TimelineSpace/unbindStreamings')
},
methods: {
async clear () {

View File

@ -10,7 +10,7 @@ export default {
})
throw err
})
await this.$store.dispatch('TimelineSpace/stopStreamings', account)
await this.$store.dispatch('TimelineSpace/stopStreamings')
await this.$store.dispatch('TimelineSpace/fetchContentsTimelines', account)
await this.$store.dispatch('TimelineSpace/startStreamings', account)
return account

View File

@ -211,11 +211,13 @@ const TimelineSpace = {
dispatch('startPublicStreaming')
}
},
stopStreamings ({ dispatch }, account) {
stopStreamings ({ dispatch }) {
dispatch('stopUserStreaming')
dispatch('stopDirectMessagesStreaming')
dispatch('stopLocalStreaming')
dispatch('stopPublicStreaming')
},
unbindStreamings ({ dispatch }) {
dispatch('unbindUserStreaming')
dispatch('unbindDirectMessagesStreaming')
dispatch('unbindLocalStreaming')