From 460193060474f3e968d83d4b965a017817387cce Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Tue, 27 Mar 2018 13:58:20 +0900
Subject: [PATCH] refs #145 Archive old statuses when close timeline
---
src/renderer/components/TimelineSpace/Home.vue | 3 +++
src/renderer/components/TimelineSpace/Notifications.vue | 3 +++
src/renderer/store/TimelineSpace.js | 6 ++++++
3 files changed, 12 insertions(+)
diff --git a/src/renderer/components/TimelineSpace/Home.vue b/src/renderer/components/TimelineSpace/Home.vue
index b339a9be..e031800b 100644
--- a/src/renderer/components/TimelineSpace/Home.vue
+++ b/src/renderer/components/TimelineSpace/Home.vue
@@ -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')
}
}
diff --git a/src/renderer/components/TimelineSpace/Notifications.vue b/src/renderer/components/TimelineSpace/Notifications.vue
index f9e2156a..7f454318 100644
--- a/src/renderer/components/TimelineSpace/Notifications.vue
+++ b/src/renderer/components/TimelineSpace/Notifications.vue
@@ -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')
}
}
diff --git a/src/renderer/store/TimelineSpace.js b/src/renderer/store/TimelineSpace.js
index ce6103d2..57b568ff 100644
--- a/src/renderer/store/TimelineSpace.js
+++ b/src/renderer/store/TimelineSpace.js
@@ -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: {