Media: Featured image modal loads only selected image when infinite scroll is disabled.

Follow-up to [52167], which partially fixed a bug introduced in [50829] that caused media modal to only load the selected image.

This commit adds additional checks to ensure infinite scroll is disabled.

Follow-up to [50829], [52167].

Props dariak, joedolson, szaqal21. 
Fixes #53765.

git-svn-id: https://develop.svn.wordpress.org/trunk@52287 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tonya Mork 2021-11-30 18:06:43 +00:00
parent e0e5eb53d4
commit aaded1d17e
2 changed files with 2 additions and 2 deletions

View File

@ -117,7 +117,7 @@ FeaturedImage = Library.extend(/** @lends wp.media.controller.FeaturedImage.prot
selection.reset( attachment ? [ attachment ] : [] );
if ( library.hasMore() ) {
if ( ! infinite_scrolling && library.hasMore() ) {
library.more();
}
}

View File

@ -104,7 +104,7 @@ ReplaceImage = Library.extend(/** @lends wp.media.controller.ReplaceImage.protot
selection.reset( attachment ? [ attachment ] : [] );
if ( library.hasMore() ) {
if ( ! infinite_scrolling && library.getTotalAttachments() == 0 && library.hasMore() ) {
library.more();
}
}