From 1bca23b3dc830e0073cf5cf0e3225ba4cf28aa9c Mon Sep 17 00:00:00 2001 From: Joep Date: Sat, 9 Sep 2023 13:44:00 +0200 Subject: [PATCH] Covnerted views/Files.vue to composition api --- frontend/src/stores/file.ts | 2 +- frontend/src/stores/layout.ts | 2 +- frontend/src/stores/upload.ts | 3 +- frontend/src/types/file.d.ts | 2 +- frontend/src/views/Files.vue | 227 ++++++++++++++++------------------ 5 files changed, 112 insertions(+), 124 deletions(-) diff --git a/frontend/src/stores/file.ts b/frontend/src/stores/file.ts index 616a7f44..e9f906f0 100644 --- a/frontend/src/stores/file.ts +++ b/frontend/src/stores/file.ts @@ -36,7 +36,7 @@ export const useFileStore = defineStore("file", { toggleMultiple() { this.multiple = !this.multiple; }, - updateRequest(value: IFile) { + updateRequest(value: IFile | null) { this.oldReq = this.req; this.req = value; }, diff --git a/frontend/src/stores/layout.ts b/frontend/src/stores/layout.ts index aa2afc87..a10efb07 100644 --- a/frontend/src/stores/layout.ts +++ b/frontend/src/stores/layout.ts @@ -25,7 +25,7 @@ export const useLayoutStore = defineStore("layout", { toggleShell() { this.showShell = !this.showShell; }, - showHover(value: LayoutValue) { + showHover(value: LayoutValue | string) { if (typeof value !== "object") { this.show = value; return; diff --git a/frontend/src/stores/upload.ts b/frontend/src/stores/upload.ts index 10bba803..2e3a3e52 100644 --- a/frontend/src/stores/upload.ts +++ b/frontend/src/stores/upload.ts @@ -20,7 +20,8 @@ export const useUploadStore = defineStore("upload", { sizes: any[], progress: any[], queue: any[], - uploads: uploads + uploads: uploads, + error: any } => ({ id: 0, sizes: [], diff --git a/frontend/src/types/file.d.ts b/frontend/src/types/file.d.ts index b025210e..4ef12ebd 100644 --- a/frontend/src/types/file.d.ts +++ b/frontend/src/types/file.d.ts @@ -16,7 +16,7 @@ interface IFile { -type uploadType = "video" | "audio" | "image" | "pdf" | "text" | "blob" +type uploadType = "video" | "audio" | "image" | "pdf" | "text" | "blob" | "textImmutable" type req = { path: string diff --git a/frontend/src/views/Files.vue b/frontend/src/views/Files.vue index ef50c51a..c47f940a 100644 --- a/frontend/src/views/Files.vue +++ b/frontend/src/views/Files.vue @@ -1,10 +1,10 @@ -