Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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 <[email protected]>
  • Loading branch information
susnux committed Sep 24, 2023
commit 95acf8a0e9b005ee1f27698cbd94427a290ad8e9
5 changes: 4 additions & 1 deletion apps/files_trashbin/src/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down