forked from AkkomaGang/akkoma-fe
Merge branch 'master' of ssh.gitgud.io:lambadalambda/pleroma-fe
This commit is contained in:
commit
362b6200c5
2 changed files with 10 additions and 6 deletions
|
@ -172,10 +172,13 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
|
||||||
updateMaxId(favorite)
|
updateMaxId(favorite)
|
||||||
favoriteStatus(favorite)
|
favoriteStatus(favorite)
|
||||||
},
|
},
|
||||||
'deletion': ({uri}) => {
|
'deletion': (deletion) => {
|
||||||
remove(allStatuses, { tag: uri })
|
const uri = deletion.uri
|
||||||
remove(timelineObject.statuses, { tag: uri })
|
updateMaxId(deletion)
|
||||||
remove(timelineObject.visibleStatuses, { tag: uri })
|
|
||||||
|
remove(allStatuses, { uri })
|
||||||
|
remove(timelineObject.statuses, { uri })
|
||||||
|
remove(timelineObject.visibleStatuses, { uri })
|
||||||
},
|
},
|
||||||
'default': (unknown) => {
|
'default': (unknown) => {
|
||||||
console.log(unknown)
|
console.log(unknown)
|
||||||
|
|
|
@ -82,7 +82,7 @@ describe('The Statuses module', () => {
|
||||||
it('removes statuses by tag on deletion', () => {
|
it('removes statuses by tag on deletion', () => {
|
||||||
const state = cloneDeep(defaultState)
|
const state = cloneDeep(defaultState)
|
||||||
const status = makeMockStatus({id: 1})
|
const status = makeMockStatus({id: 1})
|
||||||
status.tag = 'xxx'
|
status.uri = 'xxx'
|
||||||
const deletion = makeMockStatus({id: 2, is_post_verb: false})
|
const deletion = makeMockStatus({id: 2, is_post_verb: false})
|
||||||
deletion.text = 'Dolus deleted notice {{tag:gs.smuglo.li,2016-11-18:noticeId=1038007:objectType=note}}.'
|
deletion.text = 'Dolus deleted notice {{tag:gs.smuglo.li,2016-11-18:noticeId=1038007:objectType=note}}.'
|
||||||
deletion.uri= 'xxx'
|
deletion.uri= 'xxx'
|
||||||
|
@ -93,6 +93,7 @@ describe('The Statuses module', () => {
|
||||||
expect(state.allStatuses).to.eql([])
|
expect(state.allStatuses).to.eql([])
|
||||||
expect(state.timelines.public.statuses).to.eql([])
|
expect(state.timelines.public.statuses).to.eql([])
|
||||||
expect(state.timelines.public.visibleStatuses).to.eql([])
|
expect(state.timelines.public.visibleStatuses).to.eql([])
|
||||||
|
expect(state.timelines.public.maxId).to.eql(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('keeps a descending by id order in timeline.visibleStatuses and timeline.statuses', () => {
|
it('keeps a descending by id order in timeline.visibleStatuses and timeline.statuses', () => {
|
||||||
|
|
Loading…
Reference in a new issue