+
-
-
-
+
+
+
+
+
+
diff --git a/src/components/infinite-loading/infinite-loading.ts b/src/components/infinite-loading/infinite-loading.ts
index 7c7b3b4d6..6b72837f0 100644
--- a/src/components/infinite-loading/infinite-loading.ts
+++ b/src/components/infinite-loading/infinite-loading.ts
@@ -27,6 +27,7 @@ import { InfiniteScroll } from 'ionic-angular';
})
export class CoreInfiniteLoadingComponent {
@Input() enabled: boolean;
+ @Input() error = false;
@Input() position = 'bottom';
@Output() action: EventEmitter<() => void>; // Will emit an event when triggered.
diff --git a/src/core/courses/pages/search/search.html b/src/core/courses/pages/search/search.html
index 0174eb683..098a55bdf 100644
--- a/src/core/courses/pages/search/search.html
+++ b/src/core/courses/pages/search/search.html
@@ -10,7 +10,7 @@
{{ 'core.courses.totalcoursesearchresults' | translate:{$a: total} }}
-
+
diff --git a/src/core/courses/pages/search/search.ts b/src/core/courses/pages/search/search.ts
index 38607e129..e73c88b90 100644
--- a/src/core/courses/pages/search/search.ts
+++ b/src/core/courses/pages/search/search.ts
@@ -29,6 +29,7 @@ export class CoreCoursesSearchPage {
total = 0;
courses: any[];
canLoadMore: boolean;
+ loadMoreError = false;
protected page = 0;
protected currentSearch = '';
@@ -68,6 +69,8 @@ export class CoreCoursesSearchPage {
* @return {Promise} Promise resolved when done.
*/
protected searchCourses(): Promise {
+ this.loadMoreError = false;
+
return this.coursesProvider.search(this.currentSearch, this.page).then((response) => {
if (this.page === 0) {
this.courses = response.courses;
@@ -79,7 +82,7 @@ export class CoreCoursesSearchPage {
this.page++;
this.canLoadMore = this.courses.length < this.total;
}).catch((error) => {
- this.canLoadMore = false;
+ this.loadMoreError = true; // Set to prevent infinite calls with infinite-loading.
this.domUtils.showErrorModalDefault(error, 'core.courses.errorsearching', true);
});
}
diff --git a/src/core/user/components/participants/core-user-participants.html b/src/core/user/components/participants/core-user-participants.html
index 287c76baa..893b5a78a 100644
--- a/src/core/user/components/participants/core-user-participants.html
+++ b/src/core/user/components/participants/core-user-participants.html
@@ -16,7 +16,7 @@
{{ 'core.lastaccess' | translate }}: {{ participant.lastaccess * 1000 | coreFormatDate:"dfmediumdate"}}
-
+
\ No newline at end of file
diff --git a/src/core/user/components/participants/participants.ts b/src/core/user/components/participants/participants.ts
index f933be290..35475a2b4 100644
--- a/src/core/user/components/participants/participants.ts
+++ b/src/core/user/components/participants/participants.ts
@@ -34,6 +34,7 @@ export class CoreUserParticipantsComponent implements OnInit {
participantId: number;
participants = [];
canLoadMore = false;
+ loadMoreError = false;
participantsLoaded = false;
constructor(private userProvider: CoreUserProvider, private domUtils: CoreDomUtilsProvider) { }
@@ -68,6 +69,7 @@ export class CoreUserParticipantsComponent implements OnInit {
*/
fetchData(refresh: boolean = false): Promise {
const firstToGet = refresh ? 0 : this.participants.length;
+ this.loadMoreError = false;
return this.userProvider.getParticipants(this.courseId, firstToGet).then((data) => {
if (refresh) {
@@ -78,7 +80,7 @@ export class CoreUserParticipantsComponent implements OnInit {
this.canLoadMore = data.canLoadMore;
}).catch((error) => {
this.domUtils.showErrorModalDefault(error, 'Error loading participants');
- this.canLoadMore = false; // Set to false to prevent infinite calls with infinite-loading.
+ this.loadMoreError = true; // Set to prevent infinite calls with infinite-loading.
});
}