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 <opensource@fthiessen.de>
  • Loading branch information
susnux committed Jun 21, 2024
1 parent c687a9b commit b0429b2
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 @@ -60,7 +60,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 @@ -212,7 +212,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 b0429b2

Please sign in to comment.