Reload Local timeline from reload button

This commit is contained in:
AkiraFukushima 2018-06-27 21:10:40 +09:00
parent adde49d8af
commit ffa42c7e81
1 changed files with 12 additions and 1 deletions

View File

@ -26,7 +26,8 @@ export default {
lazyLoading: state => state.TimelineSpace.Contents.Local.lazyLoading,
backgroundColor: state => state.App.theme.background_color,
heading: state => state.TimelineSpace.Contents.Local.heading,
unread: state => state.TimelineSpace.Contents.Local.unreadTimeline
unread: state => state.TimelineSpace.Contents.Local.unreadTimeline,
startReload: state => state.TimelineSpace.HeaderMenu.reload
})
},
mounted () {
@ -47,6 +48,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/Local/updateToot', message)