From 622df27e41efda91bb1e96c73b105966c24ebc86 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 22 Dec 2022 16:38:20 -0600 Subject: [PATCH] Timelines: prevent max_id=undefined in home timeline requests --- app/soapbox/reducers/timelines.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/soapbox/reducers/timelines.ts b/app/soapbox/reducers/timelines.ts index 97975d658..8d2b03511 100644 --- a/app/soapbox/reducers/timelines.ts +++ b/app/soapbox/reducers/timelines.ts @@ -360,7 +360,9 @@ export default function timelines(state: State = initialState, action: AnyAction oldIdsArray = oldIdsArray.slice(1); } const positionInTimeline = sample([5, 6, 7, 8, 9]) as number; - oldIdsArray.splice(positionInTimeline, 0, `末suggestions-${oldIds.last()}`); + if (oldIds.last()) { + oldIdsArray.splice(positionInTimeline, 0, `末suggestions-${oldIds.last()}`); + } return ImmutableOrderedSet(oldIdsArray); }); }));