From 0a81ff4ffa5ca7a618127068828738d73f044a60 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Wed, 13 Dec 2023 11:08:21 +0700 Subject: [PATCH] fix: alert on folder delete and goto root --- Services/client/src/stores/storage.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Services/client/src/stores/storage.ts b/Services/client/src/stores/storage.ts index 3059a98..d63b7e4 100644 --- a/Services/client/src/stores/storage.ts +++ b/Services/client/src/stores/storage.ts @@ -281,13 +281,14 @@ const useStorage = defineStore('storageStore', () => { } if ( - currentInfo.path !== consistantPath(arr) && - currentInfo.path.length > consistantPath(arr).length && + currentInfo.path.length >= consistantPath(arr).length && currentInfo.path.startsWith(consistantPath(arr)) ) { - error.title = 'แจ้งเตือน' - error.msg = 'ข้อมูลที่คุณกำลังเข้าถึงอยู่ถูกลบ' - error.show() + error.set({ + title: 'แจ้งเตือน', + msg: 'ข้อมูลที่คุณกำลังเข้าถึงอยู่ถูกลบ', + }) + goto() } }) socket.on('FileUpload', (data: StorageFile) => {