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 { export default {
name: 'home', name: 'home',
components: { Toot }, components: { Toot },
mounted () {
this.$store.commit('TimelineSpace/SideMenu/changeUnreadHomeTimeline', false)
},
computed: { computed: {
...mapState({ ...mapState({
timeline: state => state.TimelineSpace.homeTimeline 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> </script>

View File

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