refs #145 Archive old statuses when close timeline

This commit is contained in:
AkiraFukushima 2018-03-27 13:58:20 +09:00
parent 060427f899
commit 4601930604
3 changed files with 12 additions and 0 deletions

View File

@ -25,6 +25,9 @@ export default {
if (this.$store.state.TimelineSpace.SideMenu.unreadHomeTimeline) {
this.$store.commit('TimelineSpace/SideMenu/changeUnreadHomeTimeline', false)
}
},
destroyed () {
this.$store.commit('TimelineSpace/archiveHomeTimeline')
}
}
</script>

View File

@ -25,6 +25,9 @@ export default {
if (this.$store.state.TimelineSpace.SideMenu.unreadNotifications) {
this.$store.commit('TimelineSpace/SideMenu/changeUnreadNotifications', false)
}
},
destroyed () {
this.$store.commit('TimelineSpace/archiveNotifications')
}
}
</script>

View File

@ -83,6 +83,12 @@ const TimelineSpace = {
},
clearNotifications (state) {
state.notifications = []
},
archiveHomeTimeline (state) {
state.homeTimeline = state.homeTimeline.slice(0, 40)
},
archiveNotifications (state) {
state.notifications = state.notifications.slice(0, 40)
}
},
actions: {