From 440146a372fedecdda28fca614efa3d19dab7f32 Mon Sep 17 00:00:00 2001 From: jmal Date: Wed, 31 Jul 2024 08:57:05 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowFile/ShowFile.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 229019f..e4dede4 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -1469,6 +1469,7 @@ export default { } }, onmessage(msg) { + console.log(msg.url, this.$route.path, msg, this.path) let fileDoc = msg.body const url = msg.url let index = this.fileList.findIndex(file => file.id === fileDoc.id) @@ -1482,10 +1483,9 @@ export default { this.fileList[index].updateDate = fileDoc.updateDate } } - if ('deleteFile' === url) { - if (index > -1) { - this.getFileListEnter() - } + const isCurrentPath = (this.path + '/') === fileDoc + if ('deleteFile' === url && isCurrentPath) { + this.getFileListEnter() } if ('createFile' === url) { if (fileDoc.$set) { @@ -1512,7 +1512,7 @@ export default { } this.clearOnCreateFilename() } - if (this.$route.path === '/trash' && msg.url === 'operationTips') { + if (this.$route.path.startsWith('/trash') && msg.url === 'operationTips') { this.getFileListEnter() } },