From 038e6c0b97df5e3938573d879ea14f0f55fd7165 Mon Sep 17 00:00:00 2001 From: somnetsak123 Date: Tue, 12 Dec 2023 15:57:16 +0700 Subject: [PATCH 1/2] refactor: show errorDialog delete folder --- Services/client/src/stores/storage.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Services/client/src/stores/storage.ts b/Services/client/src/stores/storage.ts index faecae2..1a31052 100644 --- a/Services/client/src/stores/storage.ts +++ b/Services/client/src/stores/storage.ts @@ -281,11 +281,11 @@ const useStorage = defineStore('storageStore', () => { ) } - const idx = folder.value[path].findIndex( - (v) => v.pathname === currentInfo.path, - ) - console.log(idx) - + if (currentInfo.path.includes(arr[arr.length - 1])) { + error.title = 'ตำเเหน่งที่คุณอยู่ถูกลบ' + error.msg = '' + error.show() + } }) socket.on('FileUpload', (data: StorageFile) => { const arr = data.pathname.split('/').filter(Boolean) From e40b80c48ee641092d44fcacfa9ad2d59c33e676 Mon Sep 17 00:00:00 2001 From: somnetsak123 Date: Tue, 12 Dec 2023 16:01:46 +0700 Subject: [PATCH 2/2] refactor: show dialog Repeat name --- Services/client/src/stores/storage.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Services/client/src/stores/storage.ts b/Services/client/src/stores/storage.ts index 1a31052..2eebab0 100644 --- a/Services/client/src/stores/storage.ts +++ b/Services/client/src/stores/storage.ts @@ -214,6 +214,10 @@ const useStorage = defineStore('storageStore', () => { createdAt: data.createdAt, createdBy: data.createdBy, }) + } else { + error.title = 'ตั้งชื่อ Folder ซ้ำ' + error.msg = '' + error.show() } folder.value[path].sort((a, b) => a.pathname.localeCompare(b.pathname))