From 95acf8a0e9b005ee1f27698cbd94427a290ad8e9 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 24 Sep 2023 17:49:21 +0200 Subject: [PATCH] fix(files_trashbin): Only remove element if loaded Make sure to only remove elements from file list (while restoring) if the element was added to the file list (might not be added, if the list is scrolling). Signed-off-by: Ferdinand Thiessen --- apps/files_trashbin/src/filelist.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files_trashbin/src/filelist.js b/apps/files_trashbin/src/filelist.js index e113b0f0ffa..79f06d2416a 100644 --- a/apps/files_trashbin/src/filelist.js +++ b/apps/files_trashbin/src/filelist.js @@ -172,7 +172,10 @@ import PQueue from 'p-queue' var $el for (var i = 0; i < files.length; i++) { $el = this.remove(OC.basename(files[i]), { updateSummary: false }) - this.fileSummary.remove({ type: $el.attr('data-type'), size: $el.attr('data-size') }) + // Only remove element if already loaded (might be unloaded if scrollable list) + if ($el) { + this.fileSummary.remove({ type: $el.attr('data-type'), size: $el.attr('data-size') }) + } } this.fileSummary.update() this.updateEmptyContent()