From 01f1887fdc2bfa9f2d071f61aad0e60433866f0f Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Thu, 24 Oct 2024 11:40:32 +0200 Subject: [PATCH] fix: files wrongly appearing in the file list Fixes the issue with files wrongly appearing in the file list during an upload. This was happening because of SSE since a check for the current folder was missing. --- changelog/unreleased/bugfix-files-appearing-in-file-list | 6 ++++++ packages/web-runtime/src/container/sse/files.ts | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/bugfix-files-appearing-in-file-list diff --git a/changelog/unreleased/bugfix-files-appearing-in-file-list b/changelog/unreleased/bugfix-files-appearing-in-file-list new file mode 100644 index 00000000000..bebb5c73bab --- /dev/null +++ b/changelog/unreleased/bugfix-files-appearing-in-file-list @@ -0,0 +1,6 @@ +Bugfix: Files appearing in file list + +We've fixed a bug where files would wrongly appear in the current file list during an ongoing upload. + +https://github.com/owncloud/web/issues/11803 +https://github.com/owncloud/web/pull/11824 diff --git a/packages/web-runtime/src/container/sse/files.ts b/packages/web-runtime/src/container/sse/files.ts index 0fed460c317..a323e2e0f36 100644 --- a/packages/web-runtime/src/container/sse/files.ts +++ b/packages/web-runtime/src/container/sse/files.ts @@ -113,7 +113,11 @@ export const onSSEProcessingFinishedEvent = async ({ path: '', fileId: sseData.itemid }) - resourcesStore.upsertResource(resource) + + // check again for the current folder in case the user has navigated away in the meantime + if (isItemInCurrentFolder({ resourcesStore, parentFolderId: sseData.parentitemid })) { + resourcesStore.upsertResource(resource) + } }) }