forked from cybrespace/mastodon
This prevents `next` state from being overridden on the loading *new* statuses.
This commit is contained in:
parent
0e12a8dab9
commit
e49dc6a06e
|
@ -107,7 +107,9 @@ export function fetchAccountTimeline(id, replace = false) {
|
||||||
let params = {};
|
let params = {};
|
||||||
let skipLoading = false;
|
let skipLoading = false;
|
||||||
|
|
||||||
if (newestId !== null && !replace) {
|
replace = replace || newestId === null;
|
||||||
|
|
||||||
|
if (!replace) {
|
||||||
params.since_id = newestId;
|
params.since_id = newestId;
|
||||||
skipLoading = true;
|
skipLoading = true;
|
||||||
}
|
}
|
||||||
|
@ -131,7 +133,9 @@ export function fetchAccountMediaTimeline(id, replace = false) {
|
||||||
let params = { only_media: 'true', limit: 12 };
|
let params = { only_media: 'true', limit: 12 };
|
||||||
let skipLoading = false;
|
let skipLoading = false;
|
||||||
|
|
||||||
if (newestId !== null && !replace) {
|
replace = replace || newestId === null;
|
||||||
|
|
||||||
|
if (!replace) {
|
||||||
params.since_id = newestId;
|
params.since_id = newestId;
|
||||||
skipLoading = true;
|
skipLoading = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ const normalizeAccountTimeline = (state, accountId, statuses, replace, next) =>
|
||||||
return state.updateIn(['accounts_timelines', accountId], Immutable.Map(), map => map
|
return state.updateIn(['accounts_timelines', accountId], Immutable.Map(), map => map
|
||||||
.set('isLoading', false)
|
.set('isLoading', false)
|
||||||
.set('loaded', true)
|
.set('loaded', true)
|
||||||
.set('next', next)
|
.update('next', null, v => replace ? next : v)
|
||||||
.update('items', Immutable.List(), list => (replace ? ids : ids.concat(list))));
|
.update('items', Immutable.List(), list => (replace ? ids : ids.concat(list))));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ const normalizeAccountMediaTimeline = (state, accountId, statuses, replace, next
|
||||||
|
|
||||||
return state.updateIn(['accounts_media_timelines', accountId], Immutable.Map(), map => map
|
return state.updateIn(['accounts_media_timelines', accountId], Immutable.Map(), map => map
|
||||||
.set('isLoading', false)
|
.set('isLoading', false)
|
||||||
.set('next', next)
|
.update('next', null, v => replace ? next : v)
|
||||||
.update('items', Immutable.List(), list => (replace ? ids : ids.concat(list))));
|
.update('items', Immutable.List(), list => (replace ? ids : ids.concat(list))));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue