Merge branch 'fix/user-timeline-again' into 'develop'
Fix user TL getting stuck again See merge request pleroma/pleroma-fe!487
This commit is contained in:
commit
d367ca9290
|
@ -2,7 +2,7 @@ import { remove, slice, each, find, maxBy, minBy, merge, last, isArray } from 'l
|
||||||
import apiService from '../services/api/api.service.js'
|
import apiService from '../services/api/api.service.js'
|
||||||
// import parse from '../services/status_parser/status_parser.js'
|
// import parse from '../services/status_parser/status_parser.js'
|
||||||
|
|
||||||
const emptyTl = () => ({
|
const emptyTl = (userId = 0) => ({
|
||||||
statuses: [],
|
statuses: [],
|
||||||
statusesObject: {},
|
statusesObject: {},
|
||||||
faves: [],
|
faves: [],
|
||||||
|
@ -14,7 +14,7 @@ const emptyTl = () => ({
|
||||||
loading: false,
|
loading: false,
|
||||||
followers: [],
|
followers: [],
|
||||||
friends: [],
|
friends: [],
|
||||||
userId: 0,
|
userId,
|
||||||
flushMarker: 0
|
flushMarker: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ export const mutations = {
|
||||||
each(oldTimeline.visibleStatuses, (status) => { oldTimeline.visibleStatusesObject[status.id] = status })
|
each(oldTimeline.visibleStatuses, (status) => { oldTimeline.visibleStatusesObject[status.id] = status })
|
||||||
},
|
},
|
||||||
clearTimeline (state, { timeline }) {
|
clearTimeline (state, { timeline }) {
|
||||||
state.timelines[timeline] = emptyTl()
|
state.timelines[timeline] = emptyTl(state.timelines[timeline].userId)
|
||||||
},
|
},
|
||||||
setFavorited (state, { status, value }) {
|
setFavorited (state, { status, value }) {
|
||||||
const newStatus = state.allStatusesObject[status.id]
|
const newStatus = state.allStatusesObject[status.id]
|
||||||
|
|
|
@ -240,6 +240,15 @@ describe('The Statuses module', () => {
|
||||||
expect(state.timelines.public.visibleStatuses[0].favorited).to.eql(true)
|
expect(state.timelines.public.visibleStatuses[0].favorited).to.eql(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('keeps userId when clearing user timeline', () => {
|
||||||
|
const state = cloneDeep(defaultState)
|
||||||
|
state.timelines.user.userId = 123
|
||||||
|
|
||||||
|
mutations.clearTimeline(state, { timeline: 'user' })
|
||||||
|
|
||||||
|
expect(state.timelines.user.userId).to.eql(123)
|
||||||
|
})
|
||||||
|
|
||||||
describe('notifications', () => {
|
describe('notifications', () => {
|
||||||
it('removes a notification when the notice gets removed', () => {
|
it('removes a notification when the notice gets removed', () => {
|
||||||
const user = { id: '1' }
|
const user = { id: '1' }
|
||||||
|
|
Loading…
Reference in New Issue