From 4fdc2f90de9f9f5ba1ad12eb99c6de7465251ccb Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 25 Jul 2021 21:16:28 +0900 Subject: [PATCH] Remove unread timeline and fix scroll position in local --- .../TimelineSpace/Contents/Local.spec.ts | 3 +- .../TimelineSpace/Contents/Local.spec.ts | 24 +++------ .../TimelineSpace/Contents/Local.vue | 52 ++++++++----------- .../store/TimelineSpace/Contents/Local.ts | 16 +----- 4 files changed, 31 insertions(+), 64 deletions(-) diff --git a/spec/renderer/integration/store/TimelineSpace/Contents/Local.spec.ts b/spec/renderer/integration/store/TimelineSpace/Contents/Local.spec.ts index 7ab103ea..b2dc2cc8 100644 --- a/spec/renderer/integration/store/TimelineSpace/Contents/Local.spec.ts +++ b/spec/renderer/integration/store/TimelineSpace/Contents/Local.spec.ts @@ -117,8 +117,7 @@ let state = (): LocalState => { return { lazyLoading: false, heading: true, - timeline: [], - unreadTimeline: [] + timeline: [] } } diff --git a/spec/renderer/unit/store/TimelineSpace/Contents/Local.spec.ts b/spec/renderer/unit/store/TimelineSpace/Contents/Local.spec.ts index 18d54fc9..f80b1aef 100644 --- a/spec/renderer/unit/store/TimelineSpace/Contents/Local.spec.ts +++ b/spec/renderer/unit/store/TimelineSpace/Contents/Local.spec.ts @@ -136,8 +136,7 @@ describe('TimelineSpace/Contents/Local', () => { state = { lazyLoading: false, heading: true, - timeline: [status2, status1], - unreadTimeline: [] + timeline: [status2, status1] } }) it('should be deleted', () => { @@ -151,8 +150,7 @@ describe('TimelineSpace/Contents/Local', () => { state = { lazyLoading: false, heading: true, - timeline: [status2, rebloggedStatus], - unreadTimeline: [] + timeline: [status2, rebloggedStatus] } }) it('should be deleted', () => { @@ -168,14 +166,12 @@ describe('TimelineSpace/Contents/Local', () => { state = { lazyLoading: false, heading: true, - timeline: [status2, status1], - unreadTimeline: [] + timeline: [status2, status1] } }) it('should be updated timeline', () => { Local.mutations![MUTATION_TYPES.APPEND_TIMELINE](state, rebloggedStatus) expect(state.timeline).toEqual([rebloggedStatus, status2, status1]) - expect(state.unreadTimeline).toEqual([]) }) }) @@ -184,14 +180,12 @@ describe('TimelineSpace/Contents/Local', () => { state = { lazyLoading: false, heading: true, - timeline: [rebloggedStatus, status2, status1], - unreadTimeline: [] + timeline: [rebloggedStatus, status2, status1] } }) it('should not be updated timeline', () => { Local.mutations![MUTATION_TYPES.APPEND_TIMELINE](state, rebloggedStatus) expect(state.timeline).toEqual([rebloggedStatus, status2, status1]) - expect(state.unreadTimeline).toEqual([]) }) }) }) @@ -202,14 +196,12 @@ describe('TimelineSpace/Contents/Local', () => { state = { lazyLoading: false, heading: false, - timeline: [status2, status1], - unreadTimeline: [] + timeline: [status2, status1] } }) it('should be updated timeline', () => { Local.mutations![MUTATION_TYPES.APPEND_TIMELINE](state, rebloggedStatus) - expect(state.timeline).toEqual([status2, status1]) - expect(state.unreadTimeline).toEqual([rebloggedStatus]) + expect(state.timeline).toEqual([rebloggedStatus, status2, status1]) }) }) @@ -218,14 +210,12 @@ describe('TimelineSpace/Contents/Local', () => { state = { lazyLoading: false, heading: false, - timeline: [rebloggedStatus, status2, status1], - unreadTimeline: [] + timeline: [rebloggedStatus, status2, status1] } }) it('should not be updated timeline', () => { Local.mutations![MUTATION_TYPES.APPEND_TIMELINE](state, rebloggedStatus) expect(state.timeline).toEqual([rebloggedStatus, status2, status1]) - expect(state.unreadTimeline).toEqual([]) }) }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/Local.vue b/src/renderer/components/TimelineSpace/Contents/Local.vue index 1c76fbda..7fe8b575 100644 --- a/src/renderer/components/TimelineSpace/Contents/Local.vue +++ b/src/renderer/components/TimelineSpace/Contents/Local.vue @@ -1,8 +1,7 @@