]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(files_trashbin): Only remove element if loaded
authorFerdinand Thiessen <opensource@fthiessen.de>
Sun, 24 Sep 2023 15:49:21 +0000 (17:49 +0200)
committerFerdinand Thiessen <opensource@fthiessen.de>
Sun, 24 Sep 2023 15:49:21 +0000 (17:49 +0200)
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 <opensource@fthiessen.de>
apps/files_trashbin/src/filelist.js

index e113b0f0ffa380892efbe25f8514f75b2e6f2ed8..79f06d2416a49691a2876b1610e6e5ba71c64aaa 100644 (file)
@@ -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()