Skip to content

Commit

Permalink
refactor(utils): small update
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelLaptev authored and gitbutler-client committed Aug 27, 2024
1 parent a9c96ee commit 71eca8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/utils/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import type { AnyFile } from '$lib/vbranches/types';

export function getNextFile(files: AnyFile[], currentId: string): AnyFile | undefined {
const fileIndex = files.findIndex((f) => f.id === currentId);
const nextFile =
fileIndex !== -1 && fileIndex + 1 < files.length ? files[fileIndex + 1] : undefined;
const nextFile = fileIndex > 0 && fileIndex + 1 < files.length ? files[fileIndex + 1] : undefined;
console.log('nextFile', nextFile);
return nextFile;
}

Expand Down

0 comments on commit 71eca8f

Please sign in to comment.