forked from AkkomaGang/akkoma-fe
Change emptlyTl to take userId
This commit is contained in:
parent
a8f6099be2
commit
b8b18b198d
1 changed files with 4 additions and 6 deletions
|
@ -2,7 +2,7 @@ import { includes, remove, slice, sortBy, toInteger, each, find, flatten, maxBy,
|
|||
import apiService from '../services/api/api.service.js'
|
||||
// import parse from '../services/status_parser/status_parser.js'
|
||||
|
||||
const emptyTl = () => ({
|
||||
const emptyTl = (userId = 0) => ({
|
||||
statuses: [],
|
||||
statusesObject: {},
|
||||
faves: [],
|
||||
|
@ -14,8 +14,8 @@ const emptyTl = () => ({
|
|||
loading: false,
|
||||
followers: [],
|
||||
friends: [],
|
||||
userId: 0,
|
||||
flushMarker: 0
|
||||
flushMarker: 0,
|
||||
userId
|
||||
})
|
||||
|
||||
export const defaultState = {
|
||||
|
@ -346,9 +346,7 @@ export const mutations = {
|
|||
each(oldTimeline.visibleStatuses, (status) => { oldTimeline.visibleStatusesObject[status.id] = status })
|
||||
},
|
||||
clearTimeline (state, { timeline }) {
|
||||
const userId = state.timelines[timeline].userId
|
||||
state.timelines[timeline] = emptyTl()
|
||||
state.timelines[timeline].userId = userId
|
||||
state.timelines[timeline] = emptyTl(state.timelines[timeline].userId)
|
||||
},
|
||||
setFavorited (state, { status, value }) {
|
||||
const newStatus = state.allStatusesObject[status.id]
|
||||
|
|
Loading…
Reference in a new issue