Merge branch 'MDL-64855-37_block_myoverview_course_category_display' of https://githu...
[moodle.git] / blocks / myoverview / amd / src / view.js
index 928469e..6a83646 100644 (file)
@@ -508,7 +508,7 @@ function(
                         }
 
                         // Set the last page to either the current or next page
-                        if (loadedPages[currentPage].courses.length < pageData.limit) {
+                        if (loadedPages[currentPage].courses.length < pageData.limit || !remainingCourses.length) {
                             lastPage = currentPage;
                             actions.allItemsLoaded(currentPage);
                         } else if (loadedPages[currentPage + 1] != undefined