Timeline: always insert new status IDs at the end
This commit is contained in:
parent
604b4397dc
commit
04e68ebc94
1 changed files with 5 additions and 3 deletions
|
@ -32,6 +32,7 @@ import {
|
||||||
} from '../actions/timelines';
|
} from '../actions/timelines';
|
||||||
|
|
||||||
import type { AnyAction } from 'redux';
|
import type { AnyAction } from 'redux';
|
||||||
|
import type { ImportPosition } from 'soapbox/entity-store/types';
|
||||||
import type { APIEntity, Status } from 'soapbox/types/entities';
|
import type { APIEntity, Status } from 'soapbox/types/entities';
|
||||||
|
|
||||||
const TRUNCATE_LIMIT = 40;
|
const TRUNCATE_LIMIT = 40;
|
||||||
|
@ -93,6 +94,7 @@ const expandNormalizedTimeline = (
|
||||||
prev: string | undefined,
|
prev: string | undefined,
|
||||||
isPartial: boolean,
|
isPartial: boolean,
|
||||||
isLoadingRecent: boolean,
|
isLoadingRecent: boolean,
|
||||||
|
pos: ImportPosition = 'end',
|
||||||
) => {
|
) => {
|
||||||
const newIds = getStatusIds(statuses);
|
const newIds = getStatusIds(statuses);
|
||||||
|
|
||||||
|
@ -113,10 +115,10 @@ const expandNormalizedTimeline = (
|
||||||
|
|
||||||
if (!newIds.isEmpty()) {
|
if (!newIds.isEmpty()) {
|
||||||
timeline.update('items', oldIds => {
|
timeline.update('items', oldIds => {
|
||||||
if (newIds.first() > oldIds.first()!) {
|
if (pos === 'end') {
|
||||||
return mergeStatusIds(oldIds, newIds);
|
|
||||||
} else {
|
|
||||||
return mergeStatusIds(newIds, oldIds);
|
return mergeStatusIds(newIds, oldIds);
|
||||||
|
} else {
|
||||||
|
return mergeStatusIds(oldIds, newIds);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue