|
|
@ -12,7 +12,8 @@ const defaultState = {
|
|
|
|
visibleStatuses: [],
|
|
|
|
visibleStatuses: [],
|
|
|
|
newStatusCount: 0,
|
|
|
|
newStatusCount: 0,
|
|
|
|
maxId: 0,
|
|
|
|
maxId: 0,
|
|
|
|
minVisibleId: 0
|
|
|
|
minVisibleId: 0,
|
|
|
|
|
|
|
|
loading: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
publicAndExternal: {
|
|
|
|
publicAndExternal: {
|
|
|
|
statuses: [],
|
|
|
|
statuses: [],
|
|
|
@ -20,7 +21,8 @@ const defaultState = {
|
|
|
|
visibleStatuses: [],
|
|
|
|
visibleStatuses: [],
|
|
|
|
newStatusCount: 0,
|
|
|
|
newStatusCount: 0,
|
|
|
|
maxId: 0,
|
|
|
|
maxId: 0,
|
|
|
|
minVisibleId: 0
|
|
|
|
minVisibleId: 0,
|
|
|
|
|
|
|
|
loading: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
friends: {
|
|
|
|
friends: {
|
|
|
|
statuses: [],
|
|
|
|
statuses: [],
|
|
|
@ -28,7 +30,8 @@ const defaultState = {
|
|
|
|
visibleStatuses: [],
|
|
|
|
visibleStatuses: [],
|
|
|
|
newStatusCount: 0,
|
|
|
|
newStatusCount: 0,
|
|
|
|
maxId: 0,
|
|
|
|
maxId: 0,
|
|
|
|
minVisibleId: 0
|
|
|
|
minVisibleId: 0,
|
|
|
|
|
|
|
|
loading: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -37,7 +40,7 @@ const statusType = (status) => {
|
|
|
|
return !status.is_post_verb && status.uri.match(/fave/) ? 'fave' : 'status'
|
|
|
|
return !status.is_post_verb && status.uri.match(/fave/) ? 'fave' : 'status'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const addStatusesToTimeline = (addedStatuses, showImmediately, { statuses, visibleStatuses, newStatusCount, faves }) => {
|
|
|
|
const addStatusesToTimeline = (addedStatuses, showImmediately, { statuses, visibleStatuses, newStatusCount, faves, loading }) => {
|
|
|
|
const statusesAndFaves = groupBy(addedStatuses, statusType)
|
|
|
|
const statusesAndFaves = groupBy(addedStatuses, statusType)
|
|
|
|
const addedFaves = statusesAndFaves['fave'] || []
|
|
|
|
const addedFaves = statusesAndFaves['fave'] || []
|
|
|
|
const unseenFaves = differenceBy(addedFaves, faves, 'id')
|
|
|
|
const unseenFaves = differenceBy(addedFaves, faves, 'id')
|
|
|
@ -92,7 +95,8 @@ const addStatusesToTimeline = (addedStatuses, showImmediately, { statuses, visib
|
|
|
|
newStatusCount: newNewStatusCount,
|
|
|
|
newStatusCount: newNewStatusCount,
|
|
|
|
maxId: newStatuses[0].id,
|
|
|
|
maxId: newStatuses[0].id,
|
|
|
|
minVisibleId: (last(newVisibleStatuses) || { id: undefined }).id,
|
|
|
|
minVisibleId: (last(newVisibleStatuses) || { id: undefined }).id,
|
|
|
|
faves: unionBy(faves, addedFaves, 'id')
|
|
|
|
faves: unionBy(faves, addedFaves, 'id'),
|
|
|
|
|
|
|
|
loading
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -138,6 +142,9 @@ const statuses = {
|
|
|
|
const newStatus = find(state.allStatuses, status)
|
|
|
|
const newStatus = find(state.allStatuses, status)
|
|
|
|
newStatus.favorited = value
|
|
|
|
newStatus.favorited = value
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
setLoading (state, { timeline, value }) {
|
|
|
|
|
|
|
|
state.timelines[timeline].loading = value
|
|
|
|
|
|
|
|
},
|
|
|
|
setNsfw (state, { id, nsfw }) {
|
|
|
|
setNsfw (state, { id, nsfw }) {
|
|
|
|
// For now, walk through all the statuses because the stuff might be in the replied_to_status
|
|
|
|
// For now, walk through all the statuses because the stuff might be in the replied_to_status
|
|
|
|
// TODO: Save the replied_tos as references.
|
|
|
|
// TODO: Save the replied_tos as references.
|
|
|
|