Skip to content

Commit

Permalink
fix(frontend): select correct first index
Browse files Browse the repository at this point in the history
Fixes #970
  • Loading branch information
IgnisDa committed Aug 17, 2024
1 parent 2317c9b commit 61416c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/frontend/app/routes/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ export const action = unstable_defineAction(async ({ request, response }) => {
e.episodeNumber === lastSeenEpisode.episode,
);
invariant(lastSeenEpisodeIndex !== -1);
const firstEpisodeIndexToMark = lastSeenEpisodeIndex + 1;
const firstEpisodeIndexToMark =
lastSeenEpisodeIndex + (latestHistoryItem ? 1 : 0);
if (selectedEpisodeIndex > firstEpisodeIndexToMark) {
for (let i = firstEpisodeIndexToMark; i < selectedEpisodeIndex; i++) {
const episode = allEpisodesInShow[i];
Expand Down

0 comments on commit 61416c4

Please sign in to comment.