Skip to content

Commit

Permalink
Merge pull request #236 from h3poteto/fix/clearTimeline
Browse files Browse the repository at this point in the history
Clear timeline after components are destroyed
  • Loading branch information
h3poteto authored Apr 17, 2018
2 parents ee93e21 + e450468 commit ef47b28
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default {
document.getElementById('scrollable').addEventListener('scroll', this.onScroll)
},
destroyed () {
this.$store.commit('TimelineSpace/Contents/Favourites/updateFavourites', [])
if (document.getElementById('scrollable') !== undefined && document.getElementById('scrollable') !== null) {
document.getElementById('scrollable').removeEventListener('scroll', this.onScroll)
}
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/TimelineSpace/Contents/Lists.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default {
this.$store.dispatch('TimelineSpace/Contents/Lists/stopStreaming')
},
destroyed () {
this.$store.commit('TimelineSpace/Contents/Lists/updateTimeline', [])
if (document.getElementById('scrollable') !== undefined && document.getElementById('scrollable') !== null) {
document.getElementById('scrollable').removeEventListener('scroll', this.onScroll)
}
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/TimelineSpace/Contents/Local.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default {
this.$store.dispatch('TimelineSpace/Contents/Local/stopLocalStreaming')
},
destroyed () {
this.$store.commit('TimelineSpace/Contents/Local/updateTimeline', [])
if (document.getElementById('scrollable') !== undefined && document.getElementById('scrollable') !== null) {
document.getElementById('scrollable').removeEventListener('scroll', this.onScroll)
}
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/TimelineSpace/Contents/Public.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default {
this.$store.dispatch('TimelineSpace/Contents/Public/stopPublicStreaming')
},
destroyed () {
this.$store.commit('TimelineSpace/Contents/Public/updateTimeline', [])
if (document.getElementById('scrollable') !== undefined && document.getElementById('scrollable') !== null) {
document.getElementById('scrollable').removeEventListener('scroll', this.onScroll)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export default {
...mapState({
results: state => state.TimelineSpace.Contents.Search.Account.results
})
},
destroyed () {
this.$store.commit('TimelineSpace/Contents/Search/Account/updateResults', [])
}
}
</script>
Expand Down

0 comments on commit ef47b28

Please sign in to comment.