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, joedolson.
Merges [51440] to the 5.8 branch.
Fixes #53672.
Built from https://develop.svn.wordpress.org/branches/5.8@51441


git-svn-id: http://core.svn.wordpress.org/branches/5.8@51052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2021-07-15 17:29:57 +00:00
parent 94a93212ba
commit 41fca9e8ba
3 changed files with 6 additions and 3 deletions

View File

@ -2074,7 +2074,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' );

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-RC3-51439';
$wp_version = '5.8-RC3-51441';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.