fix: socket CreateFolder folder doubly
This commit is contained in:
parent
456c00a5bd
commit
b30e4ebba4
1 changed files with 3 additions and 2 deletions
|
|
@ -204,10 +204,10 @@ const useStorage = defineStore('storageStore', () => {
|
|||
|
||||
if (folder.value[path]) {
|
||||
const idx = folder.value[path].findIndex(
|
||||
(v) => v.pathname === currentInfo.path,
|
||||
(v) => v.pathname === data.pathname,
|
||||
)
|
||||
|
||||
if (idx !== -1) {
|
||||
if (idx === -1) {
|
||||
folder.value[path].push({
|
||||
pathname: data.pathname,
|
||||
name: data.name,
|
||||
|
|
@ -285,6 +285,7 @@ const useStorage = defineStore('storageStore', () => {
|
|||
(v) => v.pathname === currentInfo.path,
|
||||
)
|
||||
console.log(idx)
|
||||
|
||||
})
|
||||
socket.on('FileUpload', (data: StorageFile) => {
|
||||
const arr = data.pathname.split('/').filter(Boolean)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue