From 71eca8f29972ad1407eddae9ed2c304b4d8e9777 Mon Sep 17 00:00:00 2001 From: Pavel Laptev Date: Tue, 27 Aug 2024 23:48:16 +0200 Subject: [PATCH] refactor(utils): small update --- apps/desktop/src/lib/utils/selection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/lib/utils/selection.ts b/apps/desktop/src/lib/utils/selection.ts index 35c25193d3..b7e33d9695 100644 --- a/apps/desktop/src/lib/utils/selection.ts +++ b/apps/desktop/src/lib/utils/selection.ts @@ -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; }