Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
barbalex committed Nov 28, 2024
1 parent 6355d97 commit 30d4b1a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/shared/Files/Menu/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export const Menu = memo(
const file = files.find((f) => f.fileId === fileId)
const fileIndex = files.findIndex((f) => f.fileId === fileId)

console.log('Files.Menu', { fileId, fileIndex, file })

const onClickPreview = useCallback(() => {
navigate(`${firstFileId}/Vorschau`)
}, [firstFileId])
Expand Down Expand Up @@ -129,9 +131,17 @@ export const Menu = memo(
])

const onClickNext = useCallback(() => {
const nextFile = files[fileIndex + 1] ?? files[0]
const nextFileIndex = fileIndex + 1
const nextFile = files[nextFileIndex] ?? files[0]
console.log('Files.Menu.onClickNext', {
fileId,
nextFileId: nextFile.fileId,
fileIndex,
nextFileIndex,
files,
})
navigate(`${nextFile.fileId}/Vorschau`)
}, [fileId, files, navigate, fileIndex])
}, [fileIndex, files, fileId, navigate])

const onClickPrev = useCallback(() => {
const prevFile = files[fileIndex - 1] ?? files[files.length - 1]
Expand Down

0 comments on commit 30d4b1a

Please sign in to comment.