Skip to content

Commit ece6ca2

Browse files
susnuxbackportbot-nextcloud[bot]
authored andcommitted
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 <opensource@fthiessen.de>
1 parent c125984 commit ece6ca2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/files_trashbin/src/filelist.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@
168168
var $el
169169
for (var i = 0; i < files.length; i++) {
170170
$el = this.remove(OC.basename(files[i]), { updateSummary: false })
171-
this.fileSummary.remove({ type: $el.attr('data-type'), size: $el.attr('data-size') })
171+
// Only remove element if already loaded (might be unloaded if scrollable list)
172+
if ($el) {
173+
this.fileSummary.remove({ type: $el.attr('data-type'), size: $el.attr('data-size') })
174+
}
172175
}
173176
this.fileSummary.update()
174177
this.updateEmptyContent()

0 commit comments

Comments
 (0)