Timeline: always insert new status IDs at the end

environments/review-timeline-p-4imscy/deployments/4268
Alex Gleason 2023-11-14 17:57:08 -06:00
rodzic 604b4397dc
commit 04e68ebc94
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -32,6 +32,7 @@ import {
} from '../actions/timelines';
import type { AnyAction } from 'redux';
import type { ImportPosition } from 'soapbox/entity-store/types';
import type { APIEntity, Status } from 'soapbox/types/entities';
const TRUNCATE_LIMIT = 40;
@ -93,6 +94,7 @@ const expandNormalizedTimeline = (
prev: string | undefined,
isPartial: boolean,
isLoadingRecent: boolean,
pos: ImportPosition = 'end',
) => {
const newIds = getStatusIds(statuses);
@ -113,10 +115,10 @@ const expandNormalizedTimeline = (
if (!newIds.isEmpty()) {
timeline.update('items', oldIds => {
if (newIds.first() > oldIds.first()!) {
return mergeStatusIds(oldIds, newIds);
} else {
if (pos === 'end') {
return mergeStatusIds(newIds, oldIds);
} else {
return mergeStatusIds(oldIds, newIds);
}
});
}