Media: Fix JS error in Media Library when infinite scroll enabled.

Wrap call to this.updateLoadMoreView() is wrapped in a check that infinite scroll is disabled to prevent JS errors.

Props wildworks.
Fixes #53672.

git-svn-id: https://develop.svn.wordpress.org/trunk@51440 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Dolson 2021-07-15 16:59:26 +00:00
parent 56a90eb273
commit 41ba4acb83

View File

@ -88,7 +88,10 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
}
this.updateContent();
this.updateLoadMoreView();
if ( ! infiniteScrolling ) {
this.updateLoadMoreView();
}
if ( ! this.options.sidebar || 'errors' === this.options.sidebar ) {
this.$el.addClass( 'hide-sidebar' );