diff options
Diffstat (limited to 'apps/files/src/store/selection.ts')
-rw-r--r-- | apps/files/src/store/selection.ts | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/apps/files/src/store/selection.ts b/apps/files/src/store/selection.ts index 348ace25ae4..fa35d953406 100644 --- a/apps/files/src/store/selection.ts +++ b/apps/files/src/store/selection.ts @@ -1,25 +1,8 @@ /** - * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com> - * - * @author John Molakvoæ <skjnldsv@protonmail.com> - * - * @license AGPL-3.0-or-later - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ -import type { FileId, SelectionStore } from '../types' +import type { FileSource, SelectionStore } from '../types' import { defineStore } from 'pinia' import Vue from 'vue' @@ -33,15 +16,17 @@ export const useSelectionStore = defineStore('selection', { actions: { /** * Set the selection of fileIds + * @param selection */ - set(selection = [] as FileId[]) { + set(selection = [] as FileSource[]) { Vue.set(this, 'selected', [...new Set(selection)]) }, /** * Set the last selected index + * @param lastSelectedIndex */ - setLastIndex(lastSelectedIndex = null as FileId | null) { + setLastIndex(lastSelectedIndex = null as number | null) { // Update the last selection if we provided a new selection starting point Vue.set(this, 'lastSelection', lastSelectedIndex ? this.selected : []) Vue.set(this, 'lastSelectedIndex', lastSelectedIndex) |