refs #138 Hide unread mark when user already opened the timeline

This commit is contained in:
AkiraFukushima 2018-03-26 21:58:58 +09:00
parent 233eb40cdb
commit 70a2f60031
2 changed files with 16 additions and 6 deletions

View File

@ -13,13 +13,18 @@ import Toot from './Cards/Toot'
export default {
name: 'home',
components: { Toot },
mounted () {
this.$store.commit('TimelineSpace/SideMenu/changeUnreadHomeTimeline', false)
},
computed: {
...mapState({
timeline: state => state.TimelineSpace.homeTimeline
})
},
mounted () {
this.$store.commit('TimelineSpace/SideMenu/changeUnreadHomeTimeline', false)
},
beforeUpdate () {
if (this.$store.state.TimelineSpace.SideMenu.unreadHomeTimeline) {
this.$store.commit('TimelineSpace/SideMenu/changeUnreadHomeTimeline', false)
}
}
}
</script>

View File

@ -13,13 +13,18 @@ import Notification from './Cards/Notification'
export default {
name: 'notifications',
components: { Notification },
mounted () {
this.$store.commit('TimelineSpace/SideMenu/changeUnreadNotifications', false)
},
computed: {
...mapState({
notifications: state => state.TimelineSpace.notifications
})
},
mounted () {
this.$store.commit('TimelineSpace/SideMenu/changeUnreadNotifications', false)
},
beforeUpdate () {
if (this.$store.state.TimelineSpace.SideMenu.unreadNotifications) {
this.$store.commit('TimelineSpace/SideMenu/changeUnreadNotifications', false)
}
}
}
</script>