Skip to content

Commit

Permalink
fix: Prevent invalid range for skeleton number
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Jun 21, 2024
1 parent c747090 commit 868c2e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/components/FilePicker/FileList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<LoadingTableRow v-for="index in skeletonNumber" :key="index" :show-checkbox="multiselect" />
</template>
<template v-else>
<FileListRow v-for="file in sortedFiles"
<FileListRow v-for="file of sortedFiles"
:key="file.fileid || file.path"
:allow-pick-directory="allowPickDirectory"
:show-checkbox="multiselect"
Expand Down Expand Up @@ -201,7 +201,7 @@ const fileContainer = ref<HTMLDivElement>()
}
}
// container height - 50px table header / row height of 50px
skeletonNumber.value = Math.floor((height - 50) / 50)
skeletonNumber.value = Math.max(1, Math.floor((height - 50) / 50))
})
onMounted(() => {
window.addEventListener('resize', resize)
Expand Down

0 comments on commit 868c2e5

Please sign in to comment.