Merge pull request #2416 from h3poteto/remove-old-filter

refs #2258 Delete old filter form
This commit is contained in:
AkiraFukushima 2021-05-17 21:27:24 +09:00 committed by GitHub
commit a51e6ac8e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 95 additions and 330 deletions

View File

@ -134,8 +134,7 @@ let state = (): DirectMessagesState => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
} }
@ -199,7 +198,6 @@ describe('Home', () => {
heading: true, heading: true,
timeline: [status1], timeline: [status1],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }

View File

@ -132,7 +132,6 @@ let state = (): FavouritesState => {
return { return {
favourites: [], favourites: [],
lazyLoading: false, lazyLoading: false,
filter: '',
maxId: null maxId: null
} }
} }
@ -234,7 +233,6 @@ describe('Favourites', () => {
return { return {
favourites: [], favourites: [],
lazyLoading: true, lazyLoading: true,
filter: '',
maxId: null maxId: null
} }
} }
@ -251,7 +249,6 @@ describe('Favourites', () => {
return { return {
favourites: [], favourites: [],
lazyLoading: false, lazyLoading: false,
filter: '',
maxId: null maxId: null
} }
} }
@ -268,7 +265,6 @@ describe('Favourites', () => {
return { return {
favourites: [status1], favourites: [status1],
lazyLoading: false, lazyLoading: false,
filter: '',
maxId: '2' maxId: '2'
} }
} }

View File

@ -119,8 +119,7 @@ let state = (): TagState => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
} }
@ -182,8 +181,7 @@ describe('Home', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status1], timeline: [status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
} }
}) })

View File

@ -119,7 +119,6 @@ let state = (): HomeState => {
heading: true, heading: true,
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -184,7 +183,6 @@ describe('Home', () => {
heading: true, heading: true,
timeline: [status1], timeline: [status1],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }

View File

@ -121,8 +121,7 @@ let state = (): ShowState => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
} }
@ -182,8 +181,7 @@ describe('Lists/Show', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status1], timeline: [status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
} }
}) })

View File

@ -118,8 +118,7 @@ let state = (): LocalState => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
} }
@ -182,7 +181,6 @@ describe('Home', () => {
heading: true, heading: true,
timeline: [status1], timeline: [status1],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }

View File

@ -116,8 +116,7 @@ let state: Function = () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
mentions: [], mentions: [],
unreadMentions: [], unreadMentions: []
filter: ''
} }
} }
@ -178,8 +177,7 @@ describe('Mentions', () => {
lazyLoading: true, lazyLoading: true,
heading: true, heading: true,
mentions: [], mentions: [],
unreadMentions: [], unreadMentions: []
filter: ''
} }
} }
}) })
@ -196,8 +194,7 @@ describe('Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
mentions: [mention, reblog], mentions: [mention, reblog],
unreadMentions: [], unreadMentions: []
filter: ''
} }
} }
}) })
@ -228,8 +225,7 @@ describe('Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
mentions: [mention, favourite, reblog, follow], mentions: [mention, favourite, reblog, follow],
unreadMentions: [], unreadMentions: []
filter: ''
} }
} }
}) })

View File

@ -193,8 +193,7 @@ let state = (): NotificationsState => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
notifications: [], notifications: [],
unreadNotifications: [], unreadNotifications: []
filter: ''
} }
} }
@ -255,8 +254,7 @@ describe('Notifications', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
notifications: [notification1], notifications: [notification1],
unreadNotifications: [], unreadNotifications: []
filter: ''
} }
} }
}) })

View File

@ -118,8 +118,7 @@ let state = (): PublicState => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
} }
@ -182,7 +181,6 @@ describe('Home', () => {
heading: true, heading: true,
timeline: [status1], timeline: [status1],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }

View File

@ -137,8 +137,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -153,8 +152,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, rebloggedStatus], timeline: [status2, rebloggedStatus],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -172,8 +170,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be updated timeline', () => { it('should be updated timeline', () => {
@ -189,8 +186,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [rebloggedStatus, status2, status1], timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should not be updated timeline', () => { it('should not be updated timeline', () => {
@ -208,8 +204,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be updated timeline', () => { it('should be updated timeline', () => {
@ -225,8 +220,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
timeline: [rebloggedStatus, status2, status1], timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should not be updated timeline', () => { it('should not be updated timeline', () => {

View File

@ -137,8 +137,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -153,8 +152,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, rebloggedStatus], timeline: [status2, rebloggedStatus],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -172,8 +170,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be updated timeline', () => { it('should be updated timeline', () => {
@ -189,8 +186,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [rebloggedStatus, status2, status1], timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should not be updated timeline', () => { it('should not be updated timeline', () => {
@ -208,8 +204,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be updated timeline', () => { it('should be updated timeline', () => {
@ -225,8 +220,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
timeline: [rebloggedStatus, status2, status1], timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should not be updated timeline', () => { it('should not be updated timeline', () => {

View File

@ -100,7 +100,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true, heading: true,
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -129,7 +128,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true, heading: true,
timeline: [status1], timeline: [status1],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -148,7 +146,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -169,7 +166,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: false, heading: false,
timeline: [status1], timeline: [status1],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -187,7 +183,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: false, heading: false,
timeline: [], timeline: [],
unreadTimeline: [status2, status1], unreadTimeline: [status2, status1],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -208,7 +203,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true, heading: true,
timeline: [status1], timeline: [status1],
unreadTimeline: [status2], unreadTimeline: [status2],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -227,7 +221,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true, heading: true,
timeline: [status1], timeline: [status1],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -246,7 +239,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true, heading: true,
timeline: [status1, status2], timeline: [status1, status2],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -303,7 +295,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true, heading: true,
timeline: [rebloggedStatus, status2], timeline: [rebloggedStatus, status2],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -324,7 +315,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true, heading: true,
timeline: [status1, status2], timeline: [status1, status2],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -376,7 +366,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true, heading: true,
timeline: [rebloggedStatus, status2], timeline: [rebloggedStatus, status2],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }

View File

@ -137,8 +137,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -153,8 +152,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, rebloggedStatus], timeline: [status2, rebloggedStatus],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -172,8 +170,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be updated timeline', () => { it('should be updated timeline', () => {
@ -189,8 +186,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [rebloggedStatus, status2, status1], timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should not be updated timeline', () => { it('should not be updated timeline', () => {
@ -208,8 +204,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be updated timeline', () => { it('should be updated timeline', () => {
@ -225,8 +220,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
timeline: [rebloggedStatus, status2, status1], timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should not be updated timeline', () => { it('should not be updated timeline', () => {

View File

@ -137,8 +137,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -153,8 +152,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, rebloggedStatus], timeline: [status2, rebloggedStatus],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -171,8 +169,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be updated timeline', () => { it('should be updated timeline', () => {
@ -188,8 +185,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [rebloggedStatus, status2, status1], timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should not be updated timeline', () => { it('should not be updated timeline', () => {
@ -207,8 +203,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be updated timeline', () => { it('should be updated timeline', () => {
@ -224,8 +219,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
timeline: [rebloggedStatus, status2, status1], timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should not be updated timeline', () => { it('should not be updated timeline', () => {

View File

@ -174,8 +174,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
mentions: [], mentions: [],
unreadMentions: [], unreadMentions: []
filter: ''
} }
}) })
@ -187,8 +186,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
mentions: [notification1], mentions: [notification1],
unreadMentions: [], unreadMentions: []
filter: ''
} }
}) })
it('should update mentions', () => { it('should update mentions', () => {
@ -204,8 +202,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
mentions: [notification2, notification1], mentions: [notification2, notification1],
unreadMentions: [], unreadMentions: []
filter: ''
} }
}) })
it('should not be updated mentions', () => { it('should not be updated mentions', () => {
@ -223,8 +220,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
mentions: [notification1], mentions: [notification1],
unreadMentions: [], unreadMentions: []
filter: ''
} }
}) })
it('should update mentions', () => { it('should update mentions', () => {
@ -240,8 +236,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
mentions: [notification1], mentions: [notification1],
unreadMentions: [notification2], unreadMentions: [notification2]
filter: ''
} }
}) })
it('should not be updated mentions', () => { it('should not be updated mentions', () => {
@ -259,8 +254,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
mentions: [notification1], mentions: [notification1],
unreadMentions: [notification2], unreadMentions: [notification2]
filter: ''
} }
}) })
it('should be merged', () => { it('should be merged', () => {
@ -276,8 +270,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
mentions: [notification2], mentions: [notification2],
unreadMentions: [], unreadMentions: []
filter: ''
} }
}) })
it('should be inserted', () => { it('should be inserted', () => {
@ -292,8 +285,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
mentions: [notification2, notification1], mentions: [notification2, notification1],
unreadMentions: [], unreadMentions: []
filter: ''
} }
}) })
it('should be updated', () => { it('should be updated', () => {
@ -313,8 +305,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
mentions: [notification2, notification1], mentions: [notification2, notification1],
unreadMentions: [], unreadMentions: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -328,8 +319,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
mentions: [notification2, notification1], mentions: [notification2, notification1],
unreadMentions: [], unreadMentions: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {

View File

@ -176,8 +176,7 @@ describe('TimelineSpace/Contents/Notifications', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
notifications: [notification2, notification1], notifications: [notification2, notification1],
unreadNotifications: [], unreadNotifications: []
filter: ''
} }
}) })
describe('message is not reblogged', () => { describe('message is not reblogged', () => {
@ -202,8 +201,7 @@ describe('TimelineSpace/Contents/Notifications', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
notifications: [notification1], notifications: [notification1],
unreadNotifications: [], unreadNotifications: []
filter: ''
} }
}) })
it('should update timeline', () => { it('should update timeline', () => {
@ -219,8 +217,7 @@ describe('TimelineSpace/Contents/Notifications', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
notifications: [notification2, notification1], notifications: [notification2, notification1],
unreadNotifications: [], unreadNotifications: []
filter: ''
} }
}) })
it('should not update timeline', () => { it('should not update timeline', () => {
@ -238,8 +235,7 @@ describe('TimelineSpace/Contents/Notifications', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
notifications: [notification1], notifications: [notification1],
unreadNotifications: [], unreadNotifications: []
filter: ''
} }
}) })
it('should update unreadTimeline', () => { it('should update unreadTimeline', () => {
@ -254,8 +250,7 @@ describe('TimelineSpace/Contents/Notifications', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
notifications: [notification1], notifications: [notification1],
unreadNotifications: [notification2], unreadNotifications: [notification2]
filter: ''
} }
}) })
it('should not update unreadTimeline', () => { it('should not update unreadTimeline', () => {

View File

@ -137,8 +137,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -153,8 +152,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, rebloggedStatus], timeline: [status2, rebloggedStatus],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be deleted', () => { it('should be deleted', () => {
@ -172,8 +170,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be updated timeline', () => { it('should be updated timeline', () => {
@ -189,8 +186,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [rebloggedStatus, status2, status1], timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should not be updated timeline', () => { it('should not be updated timeline', () => {
@ -208,8 +204,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
timeline: [status2, status1], timeline: [status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should be updated timeline', () => { it('should be updated timeline', () => {
@ -225,8 +220,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false, lazyLoading: false,
heading: false, heading: false,
timeline: [rebloggedStatus, status2, status1], timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [], unreadTimeline: []
filter: ''
} }
}) })
it('should not be updated timeline', () => { it('should not be updated timeline', () => {

View File

@ -74,10 +74,8 @@
"search": "Search", "search": "Search",
"lists": "Lists", "lists": "Lists",
"members": "Members", "members": "Members",
"filter": { "option": {
"title": "Filter", "title": "Option",
"placeholder": "Filter out by regular expressions",
"show_dms": "Show direct messages",
"show_reblogs": "Show reblogs", "show_reblogs": "Show reblogs",
"show_replies": "Show replies", "show_replies": "Show replies",
"apply": "Apply" "apply": "Apply"

View File

@ -57,8 +57,7 @@ export default {
}), }),
...mapState('TimelineSpace/Contents/Bookmarks', { ...mapState('TimelineSpace/Contents/Bookmarks', {
bookmarks: state => state.bookmarks, bookmarks: state => state.bookmarks,
lazyLoading: state => state.lazyLoading, lazyLoading: state => state.lazyLoading
filter: state => state.filter
}), }),
...mapGetters('TimelineSpace/Modals', ['modalOpened']), ...mapGetters('TimelineSpace/Modals', ['modalOpened']),
shortcutEnabled: function () { shortcutEnabled: function () {

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true"> <DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot <toot
:message="item" :message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId" :focused="item.uri + item.id === focusedId"
:overlaid="modalOpened" :overlaid="modalOpened"
v-on:update="updateToot" v-on:update="updateToot"
@ -49,8 +48,7 @@ export default {
timeline: state => state.timeline, timeline: state => state.timeline,
lazyLoading: state => state.lazyLoading, lazyLoading: state => state.lazyLoading,
heading: state => state.heading, heading: state => state.heading,
unread: state => state.unreadTimeline, unread: state => state.unreadTimeline
filter: state => state.filter
}), }),
...mapState({ ...mapState({
openSideBar: state => state.TimelineSpace.Contents.SideBar.openSideBar, openSideBar: state => state.TimelineSpace.Contents.SideBar.openSideBar,

View File

@ -6,7 +6,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true"> <DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot <toot
:message="item" :message="item"
:filter="filter"
:focused="item.uri === focusedId" :focused="item.uri === focusedId"
:overlaid="modalOpened" :overlaid="modalOpened"
v-on:update="updateToot" v-on:update="updateToot"
@ -51,8 +50,7 @@ export default {
startReload: state => state.TimelineSpace.HeaderMenu.reload, startReload: state => state.TimelineSpace.HeaderMenu.reload,
account: state => state.TimelineSpace.account, account: state => state.TimelineSpace.account,
favourites: state => state.TimelineSpace.Contents.Favourites.favourites, favourites: state => state.TimelineSpace.Contents.Favourites.favourites,
lazyLoading: state => state.TimelineSpace.Contents.Favourites.lazyLoading, lazyLoading: state => state.TimelineSpace.Contents.Favourites.lazyLoading
filter: state => state.TimelineSpace.Contents.Favourites.filter
}), }),
...mapGetters('TimelineSpace/Modals', ['modalOpened']), ...mapGetters('TimelineSpace/Modals', ['modalOpened']),
shortcutEnabled: function () { shortcutEnabled: function () {

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true"> <DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot <toot
:message="item" :message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId" :focused="item.uri + item.id === focusedId"
:overlaid="modalOpened" :overlaid="modalOpened"
v-on:update="updateToot" v-on:update="updateToot"
@ -53,8 +52,7 @@ export default {
timeline: state => state.TimelineSpace.Contents.Hashtag.Tag.timeline, timeline: state => state.TimelineSpace.Contents.Hashtag.Tag.timeline,
lazyLoading: state => state.TimelineSpace.Contents.Hashtag.Tag.lazyLoading, lazyLoading: state => state.TimelineSpace.Contents.Hashtag.Tag.lazyLoading,
heading: state => state.TimelineSpace.Contents.Hashtag.Tag.heading, heading: state => state.TimelineSpace.Contents.Hashtag.Tag.heading,
unread: state => state.TimelineSpace.Contents.Hashtag.Tag.unreadTimeline, unread: state => state.TimelineSpace.Contents.Hashtag.Tag.unreadTimeline
filter: state => state.TimelineSpace.Contents.Hashtag.Tag.filter
}), }),
...mapGetters('TimelineSpace/Modals', ['modalOpened']), ...mapGetters('TimelineSpace/Modals', ['modalOpened']),
shortcutEnabled: function () { shortcutEnabled: function () {

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true"> <DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot <toot
:message="item" :message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId" :focused="item.uri + item.id === focusedId"
:overlaid="modalOpened" :overlaid="modalOpened"
v-on:update="updateToot" v-on:update="updateToot"
@ -53,7 +52,6 @@ export default {
lazyLoading: state => state.TimelineSpace.Contents.Home.lazyLoading, lazyLoading: state => state.TimelineSpace.Contents.Home.lazyLoading,
heading: state => state.TimelineSpace.Contents.Home.heading, heading: state => state.TimelineSpace.Contents.Home.heading,
unread: state => state.TimelineSpace.Contents.Home.unreadTimeline, unread: state => state.TimelineSpace.Contents.Home.unreadTimeline,
filter: state => state.TimelineSpace.Contents.Home.filter,
showReblogs: state => state.TimelineSpace.Contents.Home.showReblogs, showReblogs: state => state.TimelineSpace.Contents.Home.showReblogs,
showReplies: state => state.TimelineSpace.Contents.Home.showReplies showReplies: state => state.TimelineSpace.Contents.Home.showReplies
}), }),

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true"> <DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot <toot
:message="item" :message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId" :focused="item.uri + item.id === focusedId"
:overlaid="modalOpened" :overlaid="modalOpened"
v-on:update="updateToot" v-on:update="updateToot"
@ -53,8 +52,7 @@ export default {
timeline: state => state.TimelineSpace.Contents.Lists.Show.timeline, timeline: state => state.TimelineSpace.Contents.Lists.Show.timeline,
lazyLoading: state => state.TimelineSpace.Contents.Lists.Show.lazyLoading, lazyLoading: state => state.TimelineSpace.Contents.Lists.Show.lazyLoading,
heading: state => state.TimelineSpace.Contents.Lists.Show.heading, heading: state => state.TimelineSpace.Contents.Lists.Show.heading,
unread: state => state.TimelineSpace.Contents.Lists.Show.unreadTimeline, unread: state => state.TimelineSpace.Contents.Lists.Show.unreadTimeline
filter: state => state.TimelineSpace.Contents.Lists.Show.filter
}), }),
...mapGetters('TimelineSpace/Modals', ['modalOpened']), ...mapGetters('TimelineSpace/Modals', ['modalOpened']),
shortcutEnabled: function () { shortcutEnabled: function () {

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true"> <DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot <toot
:message="item" :message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId" :focused="item.uri + item.id === focusedId"
:overlaid="modalOpened" :overlaid="modalOpened"
v-on:update="updateToot" v-on:update="updateToot"
@ -49,8 +48,7 @@ export default {
timeline: state => state.timeline, timeline: state => state.timeline,
lazyLoading: state => state.lazyLoading, lazyLoading: state => state.lazyLoading,
heading: state => state.heading, heading: state => state.heading,
unread: state => state.unreadTimeline, unread: state => state.unreadTimeline
filter: state => state.filter
}), }),
...mapState({ ...mapState({
openSideBar: state => state.TimelineSpace.Contents.SideBar.openSideBar, openSideBar: state => state.TimelineSpace.Contents.SideBar.openSideBar,

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.url]" :data-index="index" :watchData="true"> <DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.url]" :data-index="index" :watchData="true">
<notification <notification
:message="item" :message="item"
:filter="filter"
:focused="item.id === focusedId" :focused="item.id === focusedId"
:overlaid="modalOpened" :overlaid="modalOpened"
v-on:update="updateToot" v-on:update="updateToot"
@ -56,8 +55,7 @@ export default {
...mapState('TimelineSpace/Contents/Mentions', { ...mapState('TimelineSpace/Contents/Mentions', {
lazyLoading: state => state.lazyLoading, lazyLoading: state => state.lazyLoading,
heading: state => state.heading, heading: state => state.heading,
unread: state => state.unreadMentions, unread: state => state.unreadMentions
filter: state => state.filter
}), }),
...mapGetters('TimelineSpace/Modals', ['modalOpened']), ...mapGetters('TimelineSpace/Modals', ['modalOpened']),
...mapGetters('TimelineSpace/Contents/Mentions', ['mentions']), ...mapGetters('TimelineSpace/Contents/Mentions', ['mentions']),

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.url]" :data-index="index" :watchData="true"> <DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.url]" :data-index="index" :watchData="true">
<notification <notification
:message="item" :message="item"
:filter="filter"
:focused="item.id === focusedId" :focused="item.id === focusedId"
:overlaid="modalOpened" :overlaid="modalOpened"
v-on:update="updateToot" v-on:update="updateToot"
@ -50,8 +49,7 @@ export default {
backgroundColor: state => state.App.theme.background_color, backgroundColor: state => state.App.theme.background_color,
lazyLoading: state => state.TimelineSpace.Contents.Notifications.lazyLoading, lazyLoading: state => state.TimelineSpace.Contents.Notifications.lazyLoading,
heading: state => state.TimelineSpace.Contents.Notifications.heading, heading: state => state.TimelineSpace.Contents.Notifications.heading,
unread: state => state.TimelineSpace.Contents.Notifications.unreadNotifications, unread: state => state.TimelineSpace.Contents.Notifications.unreadNotifications
filter: state => state.TimelineSpace.Contents.Notifications.filter
}), }),
...mapGetters('TimelineSpace/Contents/Notifications', ['handledNotifications']), ...mapGetters('TimelineSpace/Contents/Notifications', ['handledNotifications']),
...mapGetters('TimelineSpace/Modals', ['modalOpened']), ...mapGetters('TimelineSpace/Modals', ['modalOpened']),

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true"> <DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot <toot
:message="item" :message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId" :focused="item.uri + item.id === focusedId"
:overlaid="modalOpened" :overlaid="modalOpened"
v-on:update="updateToot" v-on:update="updateToot"
@ -49,8 +48,7 @@ export default {
timeline: state => state.timeline, timeline: state => state.timeline,
lazyLoading: state => state.lazyLoading, lazyLoading: state => state.lazyLoading,
heading: state => state.heading, heading: state => state.heading,
unread: state => state.unreadTimeline, unread: state => state.unreadTimeline
filter: state => state.filter
}), }),
...mapState({ ...mapState({
openSideBar: state => state.TimelineSpace.Contents.SideBar.openSideBar, openSideBar: state => state.TimelineSpace.Contents.SideBar.openSideBar,

View File

@ -11,34 +11,19 @@
<el-button v-show="reloadable()" type="text" class="action" @click="reload" :title="$t('header_menu.reload')"> <el-button v-show="reloadable()" type="text" class="action" @click="reload" :title="$t('header_menu.reload')">
<icon name="sync-alt"></icon> <icon name="sync-alt"></icon>
</el-button> </el-button>
<el-popover placement="left-start" width="320" popper-class="theme-popover" trigger="click" v-model="filterVisible"> <el-popover placement="left-start" width="180" popper-class="theme-popover" trigger="click" v-model="TLOptionVisible">
<div> <div>
<el-form role="form" label-position="left" label-width="125px" size="medium"> <el-form role="form" label-position="left" label-width="125px" size="medium">
<el-form-item for="filter" :label="$t('header_menu.filter.title')"> <el-form-item for="show-reblogs" :label="$t('header_menu.option.show_reblogs')">
<div class="el-input">
<input
id="filter"
class="el-input__inner"
v-model="filter"
:placeholder="$t('header_menu.filter.placeholder')"
v-shortkey.avoid
:aria-label="$t('header_menu.filter.placeholder')"
:title="$t('header_menu.filter.placeholder')"
/>
</div>
</el-form-item>
<el-form-item for="show-reblogs" :label="$t('header_menu.filter.show_reblogs')" v-if="extrasFilterable()">
<el-checkbox id="show-reblogs" v-model="showReblogs"></el-checkbox> <el-checkbox id="show-reblogs" v-model="showReblogs"></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item for="show-replies" :label="$t('header_menu.filter.show_replies')" v-if="extrasFilterable()"> <el-form-item for="show-replies" :label="$t('header_menu.option.show_replies')">
<el-checkbox id="show-replies" v-model="showReplies"></el-checkbox> <el-checkbox id="show-replies" v-model="showReplies"></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item> <el-button type="primary" @click="applyTLOption">{{ $t('header_menu.option.apply') }}</el-button>
<el-button type="primary" @click="applyFilter(filter)">{{ $t('header_menu.filter.apply') }}</el-button>
</el-form-item>
</el-form> </el-form>
</div> </div>
<el-button v-show="filterable()" slot="reference" type="text" class="action" :title="$t('header_menu.filter.title')"> <el-button v-show="TLOption()" slot="reference" type="text" class="action" :title="$t('header_menu.option.title')">
<icon name="sliders-h"></icon> <icon name="sliders-h"></icon>
</el-button> </el-button>
</el-popover> </el-popover>
@ -56,8 +41,7 @@ export default {
name: 'header-menu', name: 'header-menu',
data() { data() {
return { return {
filter: '', TLOptionVisible: false,
filterVisible: false,
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
} }
@ -70,13 +54,13 @@ export default {
}, },
created() { created() {
this.channelName() this.channelName()
this.loadFilter() this.loadTLOption()
this.$store.dispatch('TimelineSpace/HeaderMenu/setupLoading') this.$store.dispatch('TimelineSpace/HeaderMenu/setupLoading')
}, },
watch: { watch: {
$route: function () { $route: function () {
this.channelName() this.channelName()
this.loadFilter() this.loadTLOption()
} }
}, },
methods: { methods: {
@ -174,94 +158,28 @@ export default {
return false return false
} }
}, },
loadFilter() { loadTLOption() {
switch (this.$route.name) { switch (this.$route.name) {
case 'home': case 'home':
this.filter = this.$store.state.TimelineSpace.Contents.Home.filter
this.showReblogs = this.$store.state.TimelineSpace.Contents.Home.showReblogs this.showReblogs = this.$store.state.TimelineSpace.Contents.Home.showReblogs
this.showReplies = this.$store.state.TimelineSpace.Contents.Home.showReplies this.showReplies = this.$store.state.TimelineSpace.Contents.Home.showReplies
break break
case 'notifications':
this.filter = this.$store.state.TimelineSpace.Contents.Notifications.filter
break
case 'mentions':
this.filter = this.$store.state.TimelineSpace.Contents.Mentions.filter
break
case 'favourites':
this.filter = this.$store.state.TimelineSpace.Contents.Favourites.filter
break
case 'local':
this.filter = this.$store.state.TimelineSpace.Contents.Local.filter
break
case 'public':
this.filter = this.$store.state.TimelineSpace.Contents.Public.filter
break
case 'tag':
this.filter = this.$store.state.TimelineSpace.Contents.Hashtag.Tag.filter
break
case 'list':
this.filter = this.$store.state.TimelineSpace.Contents.Lists.Show.filter
break
case 'direct-messages':
this.filter = this.$store.state.TimelineSpace.Contents.DirectMessages.filter
break
default: default:
console.log('Not implemented') console.log('Not implemented')
} }
}, },
applyFilter(filter) { applyTLOption() {
switch (this.$route.name) { switch (this.$route.name) {
case 'home': case 'home':
this.$store.commit('TimelineSpace/Contents/Home/changeFilter', filter)
this.$store.commit('TimelineSpace/Contents/Home/showReblogs', this.showReblogs) this.$store.commit('TimelineSpace/Contents/Home/showReblogs', this.showReblogs)
this.$store.commit('TimelineSpace/Contents/Home/showReplies', this.showReplies) this.$store.commit('TimelineSpace/Contents/Home/showReplies', this.showReplies)
break break
case 'notifications':
this.$store.commit('TimelineSpace/Contents/Notifications/changeFilter', filter)
break
case 'mentions':
this.$store.commit('TimelineSpace/Contents/Mentions/changeFilter', filter)
break
case 'favourites':
this.$store.commit('TimelineSpace/Contents/Favourites/changeFilter', filter)
break
case 'local':
this.$store.commit('TimelineSpace/Contents/Local/changeFilter', filter)
break
case 'public':
this.$store.commit('TimelineSpace/Contents/Public/changeFilter', filter)
break
case 'tag':
this.$store.commit('TimelineSpace/Contents/Hashtag/Tag/changeFilter', filter)
break
case 'list':
this.$store.commit('TimelineSpace/Contents/Lists/Show/changeFilter', filter)
break
case 'direct-messages':
this.$store.commit('TimelineSpace/Contents/DirectMessages/changeFilter', filter)
break
default: default:
console.log('Not implemented') console.log('Not implemented')
} }
this.filterVisible = false this.TLOptionVisible = false
}, },
filterable() { TLOption() {
switch (this.$route.name) {
case 'home':
case 'notifications':
case 'mentions':
case 'favourites':
case 'local':
case 'public':
case 'tag':
case 'list':
case 'direct-messages':
return true
default:
return false
}
},
extrasFilterable() {
switch (this.$route.name) { switch (this.$route.name) {
case 'home': case 'home':
return true return true

View File

@ -7,15 +7,13 @@ export type DirectMessagesState = {
heading: boolean heading: boolean
timeline: Array<Entity.Status> timeline: Array<Entity.Status>
unreadTimeline: Array<Entity.Status> unreadTimeline: Array<Entity.Status>
filter: string
} }
const state = (): DirectMessagesState => ({ const state = (): DirectMessagesState => ({
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: []
filter: ''
}) })
export const MUTATION_TYPES = { export const MUTATION_TYPES = {
@ -28,8 +26,7 @@ export const MUTATION_TYPES = {
ARCHIVE_TIMELINE: 'archiveTimeline', ARCHIVE_TIMELINE: 'archiveTimeline',
CLEAR_TIMELINE: 'clearTimeline', CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot', UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot', DELETE_TOOT: 'deleteToot'
CHANGE_FILTER: 'changeFilter'
} }
const mutations: MutationTree<DirectMessagesState> = { const mutations: MutationTree<DirectMessagesState> = {
@ -91,9 +88,6 @@ const mutations: MutationTree<DirectMessagesState> = {
return toot.id !== id return toot.id !== id
} }
}) })
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
} }
} }

View File

@ -7,14 +7,12 @@ import { LocalAccount } from '~/src/types/localAccount'
export type FavouritesState = { export type FavouritesState = {
favourites: Array<Entity.Status> favourites: Array<Entity.Status>
lazyLoading: boolean lazyLoading: boolean
filter: string
maxId: string | null maxId: string | null
} }
const state = (): FavouritesState => ({ const state = (): FavouritesState => ({
favourites: [], favourites: [],
lazyLoading: false, lazyLoading: false,
filter: '',
maxId: null maxId: null
}) })
@ -24,7 +22,6 @@ export const MUTATION_TYPES = {
UPDATE_TOOT: 'updateToot', UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot', DELETE_TOOT: 'deleteToot',
CHANGE_LAZY_LOADING: 'changeLazyLoading', CHANGE_LAZY_LOADING: 'changeLazyLoading',
CHANGE_FILTER: 'changeFilter',
CHANGE_MAX_ID: 'changeMaxId' CHANGE_MAX_ID: 'changeMaxId'
} }
@ -63,9 +60,6 @@ const mutations: MutationTree<FavouritesState> = {
[MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => { [MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => {
state.lazyLoading = value state.lazyLoading = value
}, },
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
},
[MUTATION_TYPES.CHANGE_MAX_ID]: (state, id: string | null) => { [MUTATION_TYPES.CHANGE_MAX_ID]: (state, id: string | null) => {
state.maxId = id state.maxId = id
} }

View File

@ -11,15 +11,13 @@ export type TagState = {
unreadTimeline: Array<Entity.Status> unreadTimeline: Array<Entity.Status>
lazyLoading: boolean lazyLoading: boolean
heading: boolean heading: boolean
filter: string
} }
const state = (): TagState => ({ const state = (): TagState => ({
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: [],
lazyLoading: false, lazyLoading: false,
heading: true, heading: true
filter: ''
}) })
export const MUTATION_TYPES = { export const MUTATION_TYPES = {
@ -32,8 +30,7 @@ export const MUTATION_TYPES = {
CLEAR_TIMELINE: 'clearTimeline', CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot', UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot', DELETE_TOOT: 'deleteToot',
CHANGE_LAZY_LOADING: 'changeLazyLoading', CHANGE_LAZY_LOADING: 'changeLazyLoading'
CHANGE_FILTER: 'changeFilter'
} }
const mutations: MutationTree<TagState> = { const mutations: MutationTree<TagState> = {
@ -94,9 +91,6 @@ const mutations: MutationTree<TagState> = {
}, },
[MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => { [MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => {
state.lazyLoading = value state.lazyLoading = value
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
} }
} }

View File

@ -9,7 +9,6 @@ export type HomeState = {
showReplies: boolean showReplies: boolean
timeline: Array<Entity.Status> timeline: Array<Entity.Status>
unreadTimeline: Array<Entity.Status> unreadTimeline: Array<Entity.Status>
filter: string
} }
const state = (): HomeState => ({ const state = (): HomeState => ({
@ -17,7 +16,6 @@ const state = (): HomeState => ({
heading: true, heading: true,
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: [],
filter: '',
showReblogs: true, showReblogs: true,
showReplies: true showReplies: true
}) })
@ -33,7 +31,6 @@ export const MUTATION_TYPES = {
CLEAR_TIMELINE: 'clearTimeline', CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot', UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot', DELETE_TOOT: 'deleteToot',
CHANGE_FILTER: 'changeFilter',
SHOW_REBLOGS: 'showReblogs', SHOW_REBLOGS: 'showReblogs',
SHOW_REPLIES: 'showReplies' SHOW_REPLIES: 'showReplies'
} }
@ -98,9 +95,6 @@ const mutations: MutationTree<HomeState> = {
} }
}) })
}, },
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
},
[MUTATION_TYPES.SHOW_REBLOGS]: (state, visible: boolean) => { [MUTATION_TYPES.SHOW_REBLOGS]: (state, visible: boolean) => {
state.showReblogs = visible state.showReblogs = visible
}, },

View File

@ -11,15 +11,13 @@ export type ShowState = {
unreadTimeline: Array<Entity.Status> unreadTimeline: Array<Entity.Status>
lazyLoading: boolean lazyLoading: boolean
heading: boolean heading: boolean
filter: string
} }
const state = (): ShowState => ({ const state = (): ShowState => ({
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: [],
lazyLoading: false, lazyLoading: false,
heading: true, heading: true
filter: ''
}) })
export const MUTATION_TYPES = { export const MUTATION_TYPES = {
@ -32,8 +30,7 @@ export const MUTATION_TYPES = {
CLEAR_TIMELINE: 'clearTimeline', CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot', UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot', DELETE_TOOT: 'deleteToot',
CHANGE_LAZY_LOADING: 'changeLazyLoading', CHANGE_LAZY_LOADING: 'changeLazyLoading'
CHANGE_FILTER: 'changeFilter'
} }
const mutations: MutationTree<ShowState> = { const mutations: MutationTree<ShowState> = {
@ -94,9 +91,6 @@ const mutations: MutationTree<ShowState> = {
}, },
[MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => { [MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => {
state.lazyLoading = value state.lazyLoading = value
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
} }
} }

View File

@ -7,15 +7,13 @@ export type LocalState = {
unreadTimeline: Array<Entity.Status> unreadTimeline: Array<Entity.Status>
lazyLoading: boolean lazyLoading: boolean
heading: boolean heading: boolean
filter: string
} }
const state = (): LocalState => ({ const state = (): LocalState => ({
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: [],
lazyLoading: false, lazyLoading: false,
heading: true, heading: true
filter: ''
}) })
export const MUTATION_TYPES = { export const MUTATION_TYPES = {
@ -28,8 +26,7 @@ export const MUTATION_TYPES = {
CLEAR_TIMELINE: 'clearTimeline', CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot', UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot', DELETE_TOOT: 'deleteToot',
CHANGE_LAZY_LOADING: 'changeLazyLoading', CHANGE_LAZY_LOADING: 'changeLazyLoading'
CHANGE_FILTER: 'changeFilter'
} }
const mutations: MutationTree<LocalState> = { const mutations: MutationTree<LocalState> = {
@ -90,9 +87,6 @@ const mutations: MutationTree<LocalState> = {
}, },
[MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => { [MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => {
state.lazyLoading = value state.lazyLoading = value
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
} }
} }

View File

@ -7,15 +7,13 @@ export type MentionsState = {
heading: boolean heading: boolean
mentions: Array<Entity.Notification> mentions: Array<Entity.Notification>
unreadMentions: Array<Entity.Notification> unreadMentions: Array<Entity.Notification>
filter: string
} }
const state = (): MentionsState => ({ const state = (): MentionsState => ({
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
mentions: [], mentions: [],
unreadMentions: [], unreadMentions: []
filter: ''
}) })
export const MUTATION_TYPES = { export const MUTATION_TYPES = {
@ -28,8 +26,7 @@ export const MUTATION_TYPES = {
ARCHIVE_MENTIONS: 'archiveMentions', ARCHIVE_MENTIONS: 'archiveMentions',
CLEAR_MENTIONS: 'clearMentions', CLEAR_MENTIONS: 'clearMentions',
UPDATE_TOOT: 'updateToot', UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot', DELETE_TOOT: 'deleteToot'
CHANGE_FILTER: 'changeFilter'
} }
const mutations: MutationTree<MentionsState> = { const mutations: MutationTree<MentionsState> = {
@ -90,9 +87,6 @@ const mutations: MutationTree<MentionsState> = {
return true return true
} }
}) })
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
} }
} }

View File

@ -10,15 +10,13 @@ export type NotificationsState = {
heading: boolean heading: boolean
notifications: Array<Entity.Notification> notifications: Array<Entity.Notification>
unreadNotifications: Array<Entity.Notification> unreadNotifications: Array<Entity.Notification>
filter: string
} }
const state = (): NotificationsState => ({ const state = (): NotificationsState => ({
lazyLoading: false, lazyLoading: false,
heading: true, heading: true,
notifications: [], notifications: [],
unreadNotifications: [], unreadNotifications: []
filter: ''
}) })
export const MUTATION_TYPES = { export const MUTATION_TYPES = {
@ -31,8 +29,7 @@ export const MUTATION_TYPES = {
UPDATE_TOOT: 'updateToot', UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot', DELETE_TOOT: 'deleteToot',
CLEAR_NOTIFICATIONS: 'clearNotifications', CLEAR_NOTIFICATIONS: 'clearNotifications',
ARCHIVE_NOTIFICATIONS: 'archiveNotifications', ARCHIVE_NOTIFICATIONS: 'archiveNotifications'
CHANGE_FILTER: 'changeFilter'
} }
const mutations: MutationTree<NotificationsState> = { const mutations: MutationTree<NotificationsState> = {
@ -97,9 +94,6 @@ const mutations: MutationTree<NotificationsState> = {
}, },
[MUTATION_TYPES.ARCHIVE_NOTIFICATIONS]: state => { [MUTATION_TYPES.ARCHIVE_NOTIFICATIONS]: state => {
state.notifications = state.notifications.slice(0, 30) state.notifications = state.notifications.slice(0, 30)
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
} }
} }

View File

@ -7,15 +7,13 @@ export type PublicState = {
unreadTimeline: Array<Entity.Status> unreadTimeline: Array<Entity.Status>
lazyLoading: boolean lazyLoading: boolean
heading: boolean heading: boolean
filter: string
} }
const state = (): PublicState => ({ const state = (): PublicState => ({
timeline: [], timeline: [],
unreadTimeline: [], unreadTimeline: [],
lazyLoading: false, lazyLoading: false,
heading: true, heading: true
filter: ''
}) })
export const MUTATION_TYPES = { export const MUTATION_TYPES = {
@ -28,8 +26,7 @@ export const MUTATION_TYPES = {
CLEAR_TIMELINE: 'clearTimeline', CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot', UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot', DELETE_TOOT: 'deleteToot',
CHANGE_LAZY_LOADING: 'changeLazyLoading', CHANGE_LAZY_LOADING: 'changeLazyLoading'
CHANGE_FILTER: 'changeFilter'
} }
const mutations: MutationTree<PublicState> = { const mutations: MutationTree<PublicState> = {
@ -90,9 +87,6 @@ const mutations: MutationTree<PublicState> = {
}, },
[MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => { [MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => {
state.lazyLoading = value state.lazyLoading = value
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
} }
} }