mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 10:10:49 -04:00
Nevertheless this causes a huge amount of new warnings. Previously the shell script for directories to lint was wrong it was generating all app names to lint, but was missing the `apps/` prefix. Causing only `core` to be linted. Co-authored-by: Grigorii K. Shartsev <me@shgk.me> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
/**
|
|
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
import type { FileSource, SelectionStore } from '../types'
|
|
import { defineStore } from 'pinia'
|
|
import Vue from 'vue'
|
|
|
|
export const useSelectionStore = defineStore('selection', {
|
|
state: () => ({
|
|
selected: [],
|
|
lastSelection: [],
|
|
lastSelectedIndex: null,
|
|
} as SelectionStore),
|
|
|
|
actions: {
|
|
/**
|
|
* Set the selection of fileIds
|
|
* @param selection
|
|
*/
|
|
set(selection = [] as FileSource[]) {
|
|
Vue.set(this, 'selected', [...new Set(selection)])
|
|
},
|
|
|
|
/**
|
|
* Set the last selected index
|
|
* @param lastSelectedIndex
|
|
*/
|
|
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)
|
|
},
|
|
|
|
/**
|
|
* Reset the selection
|
|
*/
|
|
reset() {
|
|
Vue.set(this, 'selected', [])
|
|
Vue.set(this, 'lastSelection', [])
|
|
Vue.set(this, 'lastSelectedIndex', null)
|
|
},
|
|
},
|
|
})
|