summaryrefslogtreecommitdiffstats
path: root/apps/files/src/store
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-04-19 11:56:27 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-04-19 12:03:53 +0200
commit6527fec10c4d6e6d854c7a87cd12fc043094d940 (patch)
treedee742915f97a68096560178643e8a01d2cd71d3 /apps/files/src/store
parentfb0fe5c01c815b7fb2aac0799f9c8c63552d5969 (diff)
downloadnextcloud-server-6527fec10c4d6e6d854c7a87cd12fc043094d940.tar.gz
nextcloud-server-6527fec10c4d6e6d854c7a87cd12fc043094d940.zip
fix(files): forward arguments to store creation
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src/store')
-rw-r--r--apps/files/src/store/files.ts8
-rw-r--r--apps/files/src/store/keyboard.ts4
-rw-r--r--apps/files/src/store/paths.ts8
-rw-r--r--apps/files/src/store/userconfig.ts4
-rw-r--r--apps/files/src/store/viewConfig.ts12
5 files changed, 18 insertions, 18 deletions
diff --git a/apps/files/src/store/files.ts b/apps/files/src/store/files.ts
index 11e4fc970a4..ea516a886d9 100644
--- a/apps/files/src/store/files.ts
+++ b/apps/files/src/store/files.ts
@@ -25,11 +25,11 @@ import type { FilesStore, RootsStore, RootOptions, Service, FilesState } from '.
import { defineStore } from 'pinia'
import { subscribe } from '@nextcloud/event-bus'
-import Vue from 'vue'
import logger from '../logger'
-import { FileId } from '../types'
+import type { FileId } from '../types'
+import Vue from 'vue'
-export const useFilesStore = () => {
+export const useFilesStore = function() {
const store = defineStore('files', {
state: (): FilesState => ({
files: {} as FilesStore,
@@ -88,7 +88,7 @@ export const useFilesStore = () => {
}
})
- const fileStore = store()
+ const fileStore = store(...arguments)
// Make sure we only register the listeners once
if (!fileStore._initialized) {
// subscribe('files:node:created', fileStore.onCreatedNode)
diff --git a/apps/files/src/store/keyboard.ts b/apps/files/src/store/keyboard.ts
index 1ba8285b960..bdce7d55075 100644
--- a/apps/files/src/store/keyboard.ts
+++ b/apps/files/src/store/keyboard.ts
@@ -28,7 +28,7 @@ import Vue from 'vue'
* special keys states. Useful for checking the
* current status of a key when executing a method.
*/
-export const useKeyboardStore = () => {
+export const useKeyboardStore = function() {
const store = defineStore('keyboard', {
state: () => ({
altKey: false,
@@ -50,7 +50,7 @@ export const useKeyboardStore = () => {
}
})
- const keyboardStore = store()
+ const keyboardStore = store(...arguments)
// Make sure we only register the listeners once
if (!keyboardStore._initialized) {
window.addEventListener('keydown', keyboardStore.onEvent)
diff --git a/apps/files/src/store/paths.ts b/apps/files/src/store/paths.ts
index bcd7375518c..c9335304bce 100644
--- a/apps/files/src/store/paths.ts
+++ b/apps/files/src/store/paths.ts
@@ -23,11 +23,11 @@
import type { PathOptions, ServicesState } from '../types.ts'
import { defineStore } from 'pinia'
-import Vue from 'vue'
import { subscribe } from '@nextcloud/event-bus'
-import { FileId } from '../types'
+import type { FileId } from '../types'
+import Vue from 'vue'
-export const usePathsStore = () => {
+export const usePathsStore = function() {
const store = defineStore('paths', {
state: (): ServicesState => ({}),
@@ -55,7 +55,7 @@ export const usePathsStore = () => {
}
})
- const pathsStore = store()
+ const pathsStore = store(...arguments)
// Make sure we only register the listeners once
if (!pathsStore._initialized) {
// TODO: watch folders to update paths?
diff --git a/apps/files/src/store/userconfig.ts b/apps/files/src/store/userconfig.ts
index c81b7b4d77f..42821951dbf 100644
--- a/apps/files/src/store/userconfig.ts
+++ b/apps/files/src/store/userconfig.ts
@@ -33,7 +33,7 @@ const userConfig = loadState('files', 'config', {
crop_image_previews: true,
}) as UserConfig
-export const useUserConfigStore = () => {
+export const useUserConfigStore = function() {
const store = defineStore('userconfig', {
state: () => ({
userConfig,
@@ -60,7 +60,7 @@ export const useUserConfigStore = () => {
}
})
- const userConfigStore = store()
+ const userConfigStore = store(...arguments)
// Make sure we only register the listeners once
if (!userConfigStore._initialized) {
diff --git a/apps/files/src/store/viewConfig.ts b/apps/files/src/store/viewConfig.ts
index d7a5ab1daa6..607596dfd68 100644
--- a/apps/files/src/store/viewConfig.ts
+++ b/apps/files/src/store/viewConfig.ts
@@ -27,12 +27,12 @@ import { loadState } from '@nextcloud/initial-state'
import axios from '@nextcloud/axios'
import Vue from 'vue'
-import { ViewConfigs, ViewConfigStore, ViewId } from '../types.ts'
-import { ViewConfig } from '../types'
+import type { ViewConfigs, ViewConfigStore, ViewId } from '../types'
+import type { ViewConfig } from '../types'
const viewConfig = loadState('files', 'viewConfigs', {}) as ViewConfigs
-export const useViewConfigStore = () => {
+export const useViewConfigStore = function() {
const store = defineStore('viewconfig', {
state: () => ({
viewConfig,
@@ -46,7 +46,7 @@ export const useViewConfigStore = () => {
/**
* Update the view config local store
*/
- onUpdate(view: ViewId, key: string, value: boolean) {
+ onUpdate(view: ViewId, key: string, value: string | number | boolean) {
if (!this.viewConfig[view]) {
Vue.set(this.viewConfig, view, {})
}
@@ -56,7 +56,7 @@ export const useViewConfigStore = () => {
/**
* Update the view config local store AND on server side
*/
- async update(view: ViewId, key: string, value: boolean) {
+ async update(view: ViewId, key: string, value: string | number | boolean) {
axios.put(generateUrl(`/apps/files/api/v1/views/${view}/${key}`), {
value,
})
@@ -88,7 +88,7 @@ export const useViewConfigStore = () => {
}
})
- const viewConfigStore = store()
+ const viewConfigStore = store(...arguments)
// Make sure we only register the listeners once
if (!viewConfigStore._initialized) {