From 5d7bc9f9ddb9021c2dfeb15d4a300ac213c23936 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 25 Jul 2021 21:01:12 +0900 Subject: [PATCH 1/9] Remove unread timeline and fix scroll position in public --- .../TimelineSpace/Contents/Public.spec.ts | 4 +- .../TimelineSpace/Contents/Public.spec.ts | 24 +++------ .../TimelineSpace/Contents/Public.vue | 53 ++++++++----------- src/renderer/components/utils/scroll.js | 20 ++++++- .../store/TimelineSpace/Contents/Public.ts | 16 +----- 5 files changed, 51 insertions(+), 66 deletions(-) diff --git a/spec/renderer/integration/store/TimelineSpace/Contents/Public.spec.ts b/spec/renderer/integration/store/TimelineSpace/Contents/Public.spec.ts index 67836cf8..13735fae 100644 --- a/spec/renderer/integration/store/TimelineSpace/Contents/Public.spec.ts +++ b/spec/renderer/integration/store/TimelineSpace/Contents/Public.spec.ts @@ -117,8 +117,7 @@ let state = (): PublicState => { return { lazyLoading: false, heading: true, - timeline: [], - unreadTimeline: [] + timeline: [] } } @@ -180,7 +179,6 @@ describe('Home', () => { lazyLoading: false, heading: true, timeline: [status1], - unreadTimeline: [], showReblogs: true, showReplies: true } diff --git a/spec/renderer/unit/store/TimelineSpace/Contents/Public.spec.ts b/spec/renderer/unit/store/TimelineSpace/Contents/Public.spec.ts index 7aea60c0..3b1b096c 100644 --- a/spec/renderer/unit/store/TimelineSpace/Contents/Public.spec.ts +++ b/spec/renderer/unit/store/TimelineSpace/Contents/Public.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', () => { @@ -169,14 +167,12 @@ describe('TimelineSpace/Contents/Local', () => { state = { lazyLoading: false, heading: true, - timeline: [status2, status1], - unreadTimeline: [] + timeline: [status2, status1] } }) it('should be updated timeline', () => { Public.mutations![MUTATION_TYPES.APPEND_TIMELINE](state, rebloggedStatus) expect(state.timeline).toEqual([rebloggedStatus, status2, status1]) - expect(state.unreadTimeline).toEqual([]) }) }) @@ -185,14 +181,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', () => { Public.mutations![MUTATION_TYPES.APPEND_TIMELINE](state, rebloggedStatus) expect(state.timeline).toEqual([rebloggedStatus, status2, status1]) - expect(state.unreadTimeline).toEqual([]) }) }) }) @@ -203,14 +197,12 @@ describe('TimelineSpace/Contents/Local', () => { state = { lazyLoading: false, heading: false, - timeline: [status2, status1], - unreadTimeline: [] + timeline: [status2, status1] } }) it('should be updated timeline', () => { Public.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]) }) }) @@ -219,14 +211,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', () => { Public.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/Public.vue b/src/renderer/components/TimelineSpace/Contents/Public.vue index 3c34417b..7be5890d 100644 --- a/src/renderer/components/TimelineSpace/Contents/Public.vue +++ b/src/renderer/components/TimelineSpace/Contents/Public.vue @@ -1,8 +1,7 @@