diff options
Diffstat (limited to 'apps/files/src/components/FileEntry/FileEntryCheckbox.vue')
-rw-r--r-- | apps/files/src/components/FileEntry/FileEntryCheckbox.vue | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files/src/components/FileEntry/FileEntryCheckbox.vue b/apps/files/src/components/FileEntry/FileEntryCheckbox.vue index bb851ed1e0e..747ff8d6cc9 100644 --- a/apps/files/src/components/FileEntry/FileEntryCheckbox.vue +++ b/apps/files/src/components/FileEntry/FileEntryCheckbox.vue @@ -33,7 +33,7 @@ <script lang="ts"> import { Node, FileType } from '@nextcloud/files' import { translate as t } from '@nextcloud/l10n' -import Vue, { PropType } from 'vue' +import { type PropType, defineComponent } from 'vue' import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js' import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js' @@ -42,7 +42,7 @@ import { useKeyboardStore } from '../../store/keyboard.ts' import { useSelectionStore } from '../../store/selection.ts' import logger from '../../logger.js' -export default Vue.extend({ +export default defineComponent({ name: 'FileEntryCheckbox', components: { @@ -52,7 +52,7 @@ export default Vue.extend({ props: { fileid: { - type: String, + type: Number, required: true, }, isLoading: { @@ -86,7 +86,7 @@ export default Vue.extend({ return this.selectedFiles.includes(this.fileid) }, index() { - return this.nodes.findIndex((node: Node) => node.fileid === parseInt(this.fileid)) + return this.nodes.findIndex((node: Node) => node.fileid === this.fileid) }, isFile() { return this.source.type === FileType.File @@ -112,8 +112,9 @@ export default Vue.extend({ const lastSelection = this.selectionStore.lastSelection const filesToSelect = this.nodes - .map(file => file.fileid?.toString?.()) + .map(file => file.fileid) .slice(start, end + 1) + .filter(Boolean) as number[] // If already selected, update the new selection _without_ the current file const selection = [...lastSelection, ...filesToSelect] |