From ccd159635c6fe4b2872052a40023126e54524be2 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Thu, 17 May 2018 22:02:59 +0900 Subject: [PATCH] refs #309 Clear unread mark when change account --- src/renderer/components/TimelineSpace.vue | 1 + src/renderer/store/TimelineSpace.js | 3 +++ src/renderer/store/TimelineSpace/SideMenu.js | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/src/renderer/components/TimelineSpace.vue b/src/renderer/components/TimelineSpace.vue index 40f7ad7a..fe9dd01c 100644 --- a/src/renderer/components/TimelineSpace.vue +++ b/src/renderer/components/TimelineSpace.vue @@ -48,6 +48,7 @@ export default { await this.$store.commit('TimelineSpace/Contents/Local/clearTimeline') await this.$store.commit('TimelineSpace/Contents/Notifications/clearNotifications') await this.$store.dispatch('TimelineSpace/removeShortcutEvents') + await this.$store.dispatch('TimelineSpace/clearUnread') return 'clear' }, async initialize () { diff --git a/src/renderer/store/TimelineSpace.js b/src/renderer/store/TimelineSpace.js index c27fcfe8..6fc02cab 100644 --- a/src/renderer/store/TimelineSpace.js +++ b/src/renderer/store/TimelineSpace.js @@ -144,6 +144,9 @@ const TimelineSpace = { } ) return 'clearAccount' + }, + async clearUnread ({ dispatch }) { + dispatch('TimelineSpace/SideMenu/clearUnread', {}, { root: true }) } } } diff --git a/src/renderer/store/TimelineSpace/SideMenu.js b/src/renderer/store/TimelineSpace/SideMenu.js index 22b630da..c5932f2e 100644 --- a/src/renderer/store/TimelineSpace/SideMenu.js +++ b/src/renderer/store/TimelineSpace/SideMenu.js @@ -37,6 +37,11 @@ const SideMenu = { resolve(res) }) }) + }, + clearUnread ({ commit }) { + commit('changeUnreadHomeTimeline', false) + commit('changeUnreadNotifications', false) + commit('changeUnreadLocalTimeline', false) } } }