Reload Favourites from reload button

This commit is contained in:
AkiraFukushima 2018-06-27 22:41:33 +09:00
parent 83f432c643
commit 657675eb5d
1 changed files with 12 additions and 1 deletions

View File

@ -22,7 +22,8 @@ export default {
account: state => state.TimelineSpace.account,
favourites: state => state.TimelineSpace.Contents.Favourites.favourites,
lazyLoading: state => state.TimelineSpace.Contents.Favourites.lazyLoading,
backgroundColor: state => state.App.theme.background_color
backgroundColor: state => state.App.theme.background_color,
startReload: state => state.TimelineSpace.HeaderMenu.reload
})
},
created () {
@ -54,6 +55,16 @@ export default {
document.getElementById('scrollable').scrollTop = 0
}
},
watch: {
startReload: function (newState, oldState) {
if (!oldState && newState) {
this.reload()
.finally(() => {
this.$store.commit('TimelineSpace/HeaderMenu/changeReload', false)
})
}
}
},
methods: {
updateToot (message) {
this.$store.commit('TimelineSpace/Contents/Favourites/updateToot', message)