fix: Stop unbind events when reload, and call unbind when destroy
This commit is contained in:
parent
09f063ca17
commit
76d133f5b4
|
@ -73,6 +73,7 @@ export default {
|
||||||
window.removeEventListener('dragover', this.onDragOver)
|
window.removeEventListener('dragover', this.onDragOver)
|
||||||
window.removeEventListener('drop', this.handleDrop)
|
window.removeEventListener('drop', this.handleDrop)
|
||||||
this.$store.dispatch('TimelineSpace/stopStreamings')
|
this.$store.dispatch('TimelineSpace/stopStreamings')
|
||||||
|
this.$store.dispatch('TimelineSpace/unbindStreamings')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async clear () {
|
async clear () {
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default {
|
||||||
})
|
})
|
||||||
throw err
|
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/fetchContentsTimelines', account)
|
||||||
await this.$store.dispatch('TimelineSpace/startStreamings', account)
|
await this.$store.dispatch('TimelineSpace/startStreamings', account)
|
||||||
return account
|
return account
|
||||||
|
|
|
@ -211,11 +211,13 @@ const TimelineSpace = {
|
||||||
dispatch('startPublicStreaming')
|
dispatch('startPublicStreaming')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
stopStreamings ({ dispatch }, account) {
|
stopStreamings ({ dispatch }) {
|
||||||
dispatch('stopUserStreaming')
|
dispatch('stopUserStreaming')
|
||||||
dispatch('stopDirectMessagesStreaming')
|
dispatch('stopDirectMessagesStreaming')
|
||||||
dispatch('stopLocalStreaming')
|
dispatch('stopLocalStreaming')
|
||||||
dispatch('stopPublicStreaming')
|
dispatch('stopPublicStreaming')
|
||||||
|
},
|
||||||
|
unbindStreamings ({ dispatch }) {
|
||||||
dispatch('unbindUserStreaming')
|
dispatch('unbindUserStreaming')
|
||||||
dispatch('unbindDirectMessagesStreaming')
|
dispatch('unbindDirectMessagesStreaming')
|
||||||
dispatch('unbindLocalStreaming')
|
dispatch('unbindLocalStreaming')
|
||||||
|
|
Loading…
Reference in New Issue