diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2024-02-01 19:00:46 +0100 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2024-02-07 07:57:23 +0000 |
commit | 97cd038cf20c5015d9dfecd0e9283367391358d2 (patch) | |
tree | 46e85f948527c83411b7c0b1bfe296010b6cbf94 /apps/files/src/components/FileEntry/FileEntryCheckbox.vue | |
parent | 9e1efe0538da54f6a57ed2516f135b957bd7e28b (diff) | |
download | nextcloud-server-97cd038cf20c5015d9dfecd0e9283367391358d2.tar.gz nextcloud-server-97cd038cf20c5015d9dfecd0e9283367391358d2.zip |
fix(files) selection store typing
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
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] |