Skip to content

Commit

Permalink
fix(files): Adjust Typescript issues
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Oct 16, 2024
1 parent 714ef08 commit 02d7807
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion apps/files/src/eventbus.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import type { Node } from '@nextcloud/files'
declare module '@nextcloud/event-bus' {
export interface NextcloudEvents {
// mapping of 'event name' => 'event type'
'files:favorites:removed': Node
'files:favorites:added': Node
'files:favorites:removed': Node
'files:node:created': Node
'files:node:deleted': Node
'files:node:renamed': Node
'files:node:updated': Node
'nextcloud:unified-search.search': { query: string }
}
}
Expand Down
3 changes: 2 additions & 1 deletion apps/files/src/store/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ const fetchNode = async (node: Node): Promise<Node> => {

export const useFilesStore = function(...args) {
const store = defineStore('files', {
state: (): FilesState => ({
state: () => ({
files: {} as FilesStore,
roots: {} as RootsStore,
_initialized: false,
}),

getters: {
Expand Down
3 changes: 2 additions & 1 deletion apps/files/src/store/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export const usePathsStore = function(...args) {
const store = defineStore('paths', {
state: () => ({
paths: {} as ServicesState,
} as PathsStore),
_initialized: false,
}),

getters: {
getPath: (state) => {
Expand Down

0 comments on commit 02d7807

Please sign in to comment.