added workaround for broken favorites
This commit is contained in:
parent
ef515056b5
commit
ef04a78634
6 changed files with 51 additions and 10 deletions
|
@ -305,6 +305,9 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
|
|||
notifications: QVITTER_USER_NOTIFICATIONS_URL,
|
||||
'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL,
|
||||
user: QVITTER_USER_TIMELINE_URL,
|
||||
// separate timeline for own posts, so it won't break due to user timeline bugs
|
||||
// really needed only for broken favorites
|
||||
own: QVITTER_USER_TIMELINE_URL,
|
||||
tag: TAG_TIMELINE_URL
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,16 @@ const backendInteractorService = (credentials) => {
|
|||
return timelineFetcherService.startFetching({timeline, store, credentials, userId})
|
||||
}
|
||||
|
||||
const fetchOldPost = ({store, postId}) => {
|
||||
return timelineFetcherService.fetchAndUpdate({
|
||||
store,
|
||||
credentials,
|
||||
timeline: 'own',
|
||||
older: true,
|
||||
until: postId
|
||||
})
|
||||
}
|
||||
|
||||
const setUserMute = ({id, muted = true}) => {
|
||||
return apiService.setUserMute({id, muted, credentials})
|
||||
}
|
||||
|
@ -86,6 +96,7 @@ const backendInteractorService = (credentials) => {
|
|||
fetchAllFollowing,
|
||||
verifyCredentials: apiService.verifyCredentials,
|
||||
startFetching,
|
||||
fetchOldPost,
|
||||
setUserMute,
|
||||
fetchMutes,
|
||||
register,
|
||||
|
|
|
@ -14,13 +14,13 @@ const update = ({store, statuses, timeline, showImmediately}) => {
|
|||
})
|
||||
}
|
||||
|
||||
const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false, showImmediately = false, userId = false, tag = false}) => {
|
||||
const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false, showImmediately = false, userId = false, tag = false, until}) => {
|
||||
const args = { timeline, credentials }
|
||||
const rootState = store.rootState || store.state
|
||||
const timelineData = rootState.statuses.timelines[camelCase(timeline)]
|
||||
|
||||
if (older) {
|
||||
args['until'] = timelineData.minVisibleId
|
||||
args['until'] = until || timelineData.minVisibleId
|
||||
} else {
|
||||
args['since'] = timelineData.maxId
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue