MOBILE-3649 core: Always use IonRefresher directly

main
Dani Palou 2021-03-12 12:22:55 +01:00
parent cc121b3011
commit 7b8fbca73b
94 changed files with 164 additions and 153 deletions

View File

@ -8,7 +8,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!badgeLoaded" (ionRefresh)="refreshBadges($event)">
<ion-refresher slot="fixed" [disabled]="!badgeLoaded" (ionRefresh)="refreshBadges($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="badgeLoaded">

View File

@ -101,7 +101,7 @@ export class AddonBadgesIssuedBadgePage implements OnInit {
*
* @param refresher Refresher.
*/
async refreshBadges(refresher?: CustomEvent<IonRefresher>): Promise<void> {
async refreshBadges(refresher?: IonRefresher): Promise<void> {
await CoreUtils.ignoreErrors(Promise.all([
AddonBadges.invalidateUserBadges(this.courseId, this.userId),
]));
@ -110,7 +110,7 @@ export class AddonBadgesIssuedBadgePage implements OnInit {
this.fetchIssuedBadge(),
]));
refresher?.detail.complete();
refresher?.complete();
}
}

View File

@ -8,7 +8,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refresh($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="loaded" class="core-loading-center">

View File

@ -250,7 +250,7 @@ export class AddonBlogEntriesPage implements OnInit {
*
* @param refresher Refresher instance.
*/
refresh(refresher?: CustomEvent<IonRefresher>): void {
refresh(refresher?: IonRefresher): void {
const promises = this.entries.map((entry) =>
CoreComments.invalidateCommentsData('user', entry.userid, this.component, entry.id, 'format_blog'));
@ -269,7 +269,7 @@ export class AddonBlogEntriesPage implements OnInit {
CoreUtils.allPromises(promises).finally(() => {
this.fetchEntries(true).finally(() => {
if (refresher) {
refresher?.detail.complete();
refresher?.complete();
}
});
});

View File

@ -21,7 +21,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -431,13 +431,13 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy {
* @param done Function to call when done.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher>, done?: () => void): Promise<void> {
async doRefresh(refresher?: IonRefresher, done?: () => void): Promise<void> {
if (!this.loaded) {
return;
}
await this.refreshData(true).finally(() => {
refresher?.detail.complete();
refresher?.complete();
done && done();
});
}

View File

@ -7,7 +7,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -363,7 +363,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
*
* @param refresher Refresher.
*/
refreshData(refresher?: CustomEvent<IonRefresher>): void {
refreshData(refresher?: IonRefresher): void {
const promises = [
AddonCalendar.invalidateAccessInformation(this.courseId),
AddonCalendar.invalidateAllowedEventTypes(this.courseId),
@ -384,7 +384,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
Promise.all(promises).finally(() => {
this.fetchData().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
});
}

View File

@ -31,7 +31,7 @@
</core-context-menu>
</core-navbar-buttons>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!eventLoaded" (ionRefresh)="doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!eventLoaded" (ionRefresh)="doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="eventLoaded">

View File

@ -402,13 +402,13 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
* @param showErrors Whether to show sync errors to the user.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher>, done?: () => void, showErrors= false): Promise<void> {
async doRefresh(refresher?: IonRefresher, done?: () => void, showErrors= false): Promise<void> {
if (!this.eventLoaded) {
return;
}
await this.refreshEvent(true, showErrors).finally(() => {
refresher?.detail.complete();
refresher?.complete();
done && done();
});
}

View File

@ -26,7 +26,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -265,13 +265,13 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy {
* @param showErrors Whether to show sync errors to the user.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher>, done?: () => void, showErrors?: boolean): Promise<void> {
async doRefresh(refresher?: IonRefresher, done?: () => void, showErrors?: boolean): Promise<void> {
if (!this.loaded) {
return;
}
await this.refreshData(true, showErrors).finally(() => {
refresher?.detail.complete();
refresher?.complete();
done && done();
});
}

View File

@ -21,7 +21,7 @@
</ion-header>
<ion-content>
<core-split-view>
<ion-refresher slot="fixed" [disabled]="!eventsLoaded" (ionRefresh)="doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!eventsLoaded" (ionRefresh)="doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="eventsLoaded">

View File

@ -549,13 +549,13 @@ export class AddonCalendarListPage implements OnInit, OnDestroy {
* @param showErrors Whether to show sync errors to the user.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher>, done?: () => void, showErrors?: boolean): Promise<void> {
async doRefresh(refresher?: IonRefresher, done?: () => void, showErrors?: boolean): Promise<void> {
if (!this.eventsLoaded) {
return;
}
await this.refreshEvents(true, showErrors).finally(() => {
refresher?.detail.complete();
refresher?.complete();
done && done();
});
}

View File

@ -7,7 +7,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!devicesLoaded" (ionRefresh)="refreshDevices($event)">
<ion-refresher slot="fixed" [disabled]="!devicesLoaded" (ionRefresh)="refreshDevices($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="devicesLoaded">

View File

@ -106,13 +106,13 @@ export class AddonMessageOutputAirnotifierDevicesPage implements OnInit, OnDestr
*
* @param refresher Refresher.
*/
async refreshDevices(refresher: CustomEvent<IonRefresher>): Promise<void> {
async refreshDevices(refresher: IonRefresher): Promise<void> {
try {
await CoreUtils.ignoreErrors(AddonMessageOutputAirnotifier.invalidateUserDevices());
await this.fetchDevices();
} finally {
refresher?.detail.complete();
refresher?.complete();
}
}

View File

@ -9,7 +9,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -122,7 +122,7 @@ export class AddonMessagesConversationInfoComponent implements OnInit {
* @param refresher Refresher.
* @return Promise resolved when done.
*/
async refreshData(refresher?: CustomEvent<IonRefresher>): Promise<void> {
async refreshData(refresher?: IonRefresher): Promise<void> {
const promises: Promise<void>[] = [];
promises.push(AddonMessages.invalidateConversation(this.conversationId));
@ -131,7 +131,7 @@ export class AddonMessagesConversationInfoComponent implements OnInit {
await Promise.all(promises);
await this.fetchData().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
}

View File

@ -13,7 +13,7 @@
</ion-header>
<ion-content>
<core-split-view>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -128,7 +128,7 @@ export class AddonMessagesContacts35Page implements OnInit, OnDestroy {
* @param refresher Refresher.
* @return Promise resolved when done.
*/
async refreshData(refresher?: CustomEvent<IonRefresher>): Promise<void> {
async refreshData(refresher?: IonRefresher): Promise<void> {
try {
if (this.searchString) {
// User has searched, update the search.
@ -139,7 +139,7 @@ export class AddonMessagesContacts35Page implements OnInit, OnDestroy {
await this.fetchData();
}
} finally {
refresher?.detail.complete();
refresher?.complete();
}
}

View File

@ -21,7 +21,7 @@
<!-- Contacts tab. -->
<core-tab [title]="'addon.messages.contacts' | translate" (ionSelect)="selectTab('confirmed')">
<ng-template>
<ion-refresher slot="fixed" [disabled]="!confirmedLoaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!confirmedLoaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="confirmedLoaded" class="core-loading-center">
@ -57,7 +57,7 @@
<!-- Requests tab. -->
<core-tab [title]="'addon.messages.requests' | translate" (ionSelect)="selectTab('requests')" [badge]="requestsBadge">
<ng-template>
<ion-refresher slot="fixed" [disabled]="!requestsLoaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!requestsLoaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="requestsLoaded" class="core-loading-center">

View File

@ -185,7 +185,7 @@ export class AddonMessagesContactsPage implements OnInit, OnDestroy {
* @param refresher Refresher.
* @return Promise resolved when done.
*/
async refreshData(refresher?: CustomEvent<IonRefresher>): Promise<void> {
async refreshData(refresher?: IonRefresher): Promise<void> {
try {
if (this.selected == 'confirmed') {
// No need to invalidate contacts, we always try to get the latest.
@ -198,7 +198,7 @@ export class AddonMessagesContactsPage implements OnInit, OnDestroy {
await this.requestsFetchData(true);
}
} finally {
refresher?.detail.complete();
refresher?.complete();
}
}

View File

@ -13,7 +13,7 @@
</ion-header>
<ion-content>
<core-split-view>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -168,7 +168,7 @@ export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy {
* @param refreshUnreadCounts Whteher to refresh unread counts.
* @return Promise resolved when done.
*/
async refreshData(refresher?: CustomEvent<IonRefresher>, refreshUnreadCounts: boolean = true): Promise<void> {
async refreshData(refresher?: IonRefresher, refreshUnreadCounts: boolean = true): Promise<void> {
const promises: Promise<void>[] = [];
promises.push(AddonMessages.invalidateDiscussionsCache(this.siteId));
@ -178,7 +178,7 @@ export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy {
await CoreUtils.allPromises(promises).finally(() => this.fetchData().finally(() => {
if (refresher) {
refresher?.detail.complete();
refresher?.complete();
}
}));
}

View File

@ -19,7 +19,7 @@
</ion-header>
<ion-content class="core-expand-max">
<core-split-view>
<ion-refresher slot="fixed" [disabled]="!loaded || !currentListEl" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!loaded || !currentListEl" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -700,7 +700,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
* @param refreshUnreadCounts Whether to refresh unread counts.
* @return Promise resolved when done.
*/
async refreshData(refresher?: CustomEvent<IonRefresher>, refreshUnreadCounts: boolean = true): Promise<void> {
async refreshData(refresher?: IonRefresher, refreshUnreadCounts: boolean = true): Promise<void> {
// Don't invalidate conversations and so, they always try to get latest data.
try {
await AddonMessages.invalidateContactRequestsCountCache(this.siteId);
@ -709,7 +709,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
await this.fetchData(refreshUnreadCounts);
} finally {
if (refresher) {
refresher?.detail.complete();
refresher?.complete();
}
}
}

View File

@ -7,7 +7,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!preferencesLoaded" (ionRefresh)="refreshPreferences($event)">
<ion-refresher slot="fixed" [disabled]="!preferencesLoaded" (ionRefresh)="refreshPreferences($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="preferencesLoaded">

View File

@ -251,10 +251,10 @@ export class AddonMessagesSettingsPage implements OnInit, OnDestroy {
*
* @param refresher Refresher.
*/
refreshPreferences(refresher?: CustomEvent<IonRefresher>): void {
refreshPreferences(refresher?: IonRefresher): void {
AddonMessages.invalidateMessagePreferences().finally(() => {
this.fetchPreferences().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
});
}

View File

@ -14,7 +14,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -14,7 +14,7 @@
<ion-content>
<core-split-view>
<ion-refresher slot="fixed" [disabled]="!loaded || !submissions.loaded" (ionRefresh)="refreshList($event)">
<ion-refresher slot="fixed" [disabled]="!loaded || !submissions.loaded" (ionRefresh)="refreshList($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="loaded && submissions.loaded">

View File

@ -328,9 +328,9 @@ export class AddonModAssignSubmissionListPage implements AfterViewInit, OnDestro
*
* @param refresher Refresher.
*/
refreshList(refresher?: CustomEvent<IonRefresher>): void {
refreshList(refresher?: IonRefresher): void {
this.refreshAllData(true).finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
}

View File

@ -19,7 +19,7 @@
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshSubmission($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshSubmission($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="loaded">

View File

@ -155,9 +155,9 @@ export class AddonModAssignSubmissionReviewPage implements OnInit, CanLeave {
*
* @param refresher Refresher.
*/
refreshSubmission(refresher?: CustomEvent<IonRefresher>): void {
refreshSubmission(refresher?: IonRefresher): void {
this.refreshAllData().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
}

View File

@ -13,7 +13,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -15,7 +15,7 @@
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="subfolder || !activityComponent?.loaded"
(ionRefresh)="activityComponent?.doRefresh($event)">
(ionRefresh)="activityComponent?.doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -37,7 +37,7 @@
<!-- Content. -->
<core-split-view>
<ion-refresher slot="fixed" [disabled]="!discussions.loaded" (ionRefresh)="doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!discussions.loaded" (ionRefresh)="doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -61,7 +61,7 @@
</core-context-menu>
</core-navbar-buttons>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!discussionLoaded" (ionRefresh)="doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!discussionLoaded" (ionRefresh)="doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -21,7 +21,7 @@ import { CoreRatingOffline } from '@features/rating/services/rating-offline';
import { CoreRatingSyncProvider } from '@features/rating/services/rating-sync';
import { CoreUser } from '@features/user/services/user';
import { CanLeave } from '@guards/can-leave';
import { IonContent } from '@ionic/angular';
import { IonContent, IonRefresher } from '@ionic/angular';
import { CoreApp } from '@services/app';
import { CoreNavigator } from '@services/navigator';
import { CoreScreen } from '@services/screen';
@ -612,10 +612,10 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
* @param showErrors If show errors to the user of hide them.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: any, done?: () => void, showErrors: boolean = false): Promise<void> {
async doRefresh(refresher?: IonRefresher | null, done?: () => void, showErrors: boolean = false): Promise<void> {
if (this.discussionLoaded) {
await this.refreshPosts(true, showErrors).finally(() => {
refresher && refresher.complete();
refresher?.complete();
done && done();
});
}
@ -651,7 +651,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
* @param type Sort type.
* @return Promised resolved when done.
*/
changeSort(type: SortType): Promise<any> {
changeSort(type: SortType): Promise<void> {
this.discussionLoaded = false;
this.sort = type;
CoreSites.getCurrentSite()!.setLocalSiteConfig('AddonModForumDiscussionSort', this.sort);

View File

@ -7,7 +7,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -98,9 +98,9 @@ export class AddonModLessonUserRetakePage implements OnInit {
*
* @param refresher Refresher.
*/
doRefresh(refresher: CustomEvent<IonRefresher>): void {
doRefresh(refresher: IonRefresher): void {
this.refreshData().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
}

View File

@ -14,7 +14,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -13,7 +13,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -14,7 +14,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -16,7 +16,7 @@
<ion-content>
<ion-refresher slot="fixed"
[disabled]="!activityComponent?.loaded || activityComponent?.mode != 'external'"
(ionRefresh)="activityComponent?.doRefresh($event)">
(ionRefresh)="activityComponent?.doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -13,7 +13,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -7,7 +7,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!notificationsLoaded" (ionRefresh)="refreshNotifications($event)">
<ion-refresher slot="fixed" [disabled]="!notificationsLoaded" (ionRefresh)="refreshNotifications($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="notificationsLoaded">

View File

@ -174,13 +174,13 @@ export class AddonNotificationsListPage implements OnInit, OnDestroy {
* @param refresher Refresher.
* @return Promise<any> Promise resolved when done.
*/
async refreshNotifications(refresher?: CustomEvent<IonRefresher>): Promise<void> {
async refreshNotifications(refresher?: IonRefresher): Promise<void> {
await CoreUtils.ignoreErrors(AddonNotifications.invalidateNotificationsList());
try {
await this.fetchNotifications(true);
} finally {
refresher?.detail.complete();
refresher?.complete();
}
}

View File

@ -16,7 +16,8 @@
</core-context-menu>
</core-navbar-buttons>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!preferencesLoaded || !notifPrefsEnabled" (ionRefresh)="refreshPreferences($event)">
<ion-refresher slot="fixed" [disabled]="!preferencesLoaded || !notifPrefsEnabled"
(ionRefresh)="refreshPreferences($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="preferencesLoaded">

View File

@ -179,13 +179,13 @@ export class AddonNotificationsSettingsPage implements OnInit, OnDestroy {
*
* @param refresher Refresher.
*/
async refreshPreferences(refresher?: CustomEvent<IonRefresher>): Promise<void> {
async refreshPreferences(refresher?: IonRefresher): Promise<void> {
try {
await CoreUtils.ignoreErrors(AddonNotifications.invalidateNotificationPreferences());
await this.fetchPreferences();
} finally {
refresher?.detail.complete();
refresher?.complete();
}
}

View File

@ -8,7 +8,7 @@
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!filesLoaded || (!showPrivateFiles && !showSiteFiles)"
(ionRefresh)="refreshData($event)">
(ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -119,9 +119,9 @@ export class AddonPrivateFilesIndexPage implements OnInit, OnDestroy {
*
* @param refresher Refresher.
*/
refreshData(event?: CustomEvent<IonRefresher>): void {
refreshData(event?: IonRefresher): void {
this.refreshFiles().finally(() => {
event?.detail.complete();
event?.complete();
});
}

View File

@ -71,10 +71,10 @@ export abstract class CoreBlockBaseComponent implements OnInit {
* @param showErrors If show errors to the user of hide them.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher>, done?: () => void, showErrors: boolean = false): Promise<void> {
async doRefresh(refresher?: IonRefresher, done?: () => void, showErrors: boolean = false): Promise<void> {
if (this.loaded) {
return this.refreshContent(showErrors).finally(() => {
refresher?.detail.complete();
refresher?.complete();
done && done();
});
}

View File

@ -140,7 +140,7 @@ export class CoreBlockComponent implements OnInit, OnDestroy, DoCheck {
* @return Promise resolved when done.
*/
async doRefresh(
refresher?: CustomEvent<IonRefresher>,
refresher?: IonRefresher,
done?: () => void,
showErrors: boolean = false,
): Promise<void> {

View File

@ -26,7 +26,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!commentsLoaded" (ionRefresh)="refreshComments(false, $event)">
<ion-refresher slot="fixed" [disabled]="!commentsLoaded" (ionRefresh)="refreshComments(false, $event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="commentsLoaded">

View File

@ -205,7 +205,7 @@ export class CoreCommentsViewerPage implements OnInit, OnDestroy {
* @param refresher Refresher.
* @return Resolved when done.
*/
async refreshComments(showErrors: boolean, refresher?: CustomEvent<IonRefresher>): Promise<void> {
async refreshComments(showErrors: boolean, refresher?: IonRefresher): Promise<void> {
this.commentsLoaded = false;
this.refreshIcon = CoreConstants.ICON_LOADING;
this.syncIcon = CoreConstants.ICON_LOADING;
@ -219,7 +219,7 @@ export class CoreCommentsViewerPage implements OnInit, OnDestroy {
try {
await this.fetchComments(true, showErrors);
} finally {
refresher?.detail.complete();
refresher?.complete();
}
}
}

View File

@ -105,7 +105,7 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy,
* @param showErrors If show errors to the user of hide them.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher> | null, done?: () => void, showErrors: boolean = false): Promise<void> {
async doRefresh(refresher?: IonRefresher | null, done?: () => void, showErrors: boolean = false): Promise<void> {
if (!this.loaded || !this.module) {
// Module can be undefined if course format changes from single activity to weekly/topics.
return;
@ -119,7 +119,7 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy,
await CoreUtils.ignoreErrors(this.refreshContent(true, showErrors));
refresher?.detail.complete();
refresher?.complete();
done && done();
}

View File

@ -497,7 +497,7 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
* @param afterCompletionChange Whether the refresh is due to a completion change.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher>, done?: () => void, afterCompletionChange?: boolean): Promise<void> {
async doRefresh(refresher?: IonRefresher, done?: () => void, afterCompletionChange?: boolean): Promise<void> {
const promises = this.dynamicComponents?.map(async (component) => {
await component.callComponentFunction('doRefresh', [refresher, done, afterCompletionChange]);
}) || [];
@ -508,7 +508,7 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
await Promise.all(promises);
refresher?.detail.complete();
refresher?.complete();
done?.();
}

View File

@ -78,7 +78,7 @@ export class CoreCourseFormatSingleActivityComponent implements OnChanges {
* @param afterCompletionChange Whether the refresh is due to a completion change.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher>, done?: () => void, afterCompletionChange?: boolean): Promise<void> {
async doRefresh(refresher?: IonRefresher, done?: () => void, afterCompletionChange?: boolean): Promise<void> {
if (afterCompletionChange) {
// Don't refresh the view after a completion change since completion isn't displayed.
return;

View File

@ -16,7 +16,7 @@
</core-context-menu>
</core-navbar-buttons>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!dataLoaded || !displayRefresher" (ionRefresh)="doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!dataLoaded || !displayRefresher" (ionRefresh)="doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
@ -26,4 +26,4 @@
(completionChanged)="onCompletionChange($event)" class="core-course-format-{{course.format}}">
</core-course-format>
</core-loading>
</ion-content>
</ion-content>

View File

@ -327,7 +327,7 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy {
* @param refresher Refresher.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher>): Promise<void> {
async doRefresh(refresher?: IonRefresher): Promise<void> {
await CoreUtils.ignoreErrors(this.invalidateData());
try {
@ -339,7 +339,7 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy {
await CoreUtils.ignoreErrors(this.formatComponent.doRefresh(refresher));
}
refresher?.detail.complete();
refresher?.complete();
}
}

View File

@ -7,7 +7,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="loaded">
@ -25,4 +25,4 @@
</ng-container>
</ion-list>
</core-loading>
</ion-content>
</ion-content>

View File

@ -119,13 +119,13 @@ export class CoreCourseListModTypePage implements OnInit {
* @param refresher Refresher.
* @return Promise resolved when done.
*/
async refreshData(refresher: CustomEvent<IonRefresher>): Promise<void> {
async refreshData(refresher: IonRefresher): Promise<void> {
await CoreUtils.ignoreErrors(CoreCourse.invalidateSections(this.courseId || 0));
try {
await this.fetchData();
} finally {
refresher.detail.complete();
refresher.complete();
}
}

View File

@ -9,7 +9,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!dataLoaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!dataLoaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="dataLoaded">

View File

@ -379,7 +379,7 @@ export class CoreCoursePreviewPage implements OnInit, OnDestroy {
*
* @param refresher The refresher if this was triggered by a Pull To Refresh.
*/
async refreshData(refresher?: CustomEvent<IonRefresher>): Promise<void> {
async refreshData(refresher?: IonRefresher): Promise<void> {
const promises: Promise<void>[] = [];
promises.push(CoreCourses.invalidateUserCourses());
@ -394,7 +394,7 @@ export class CoreCoursePreviewPage implements OnInit, OnDestroy {
}
await Promise.all(promises).finally(() => this.getCourse()).finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
}

View File

@ -184,7 +184,7 @@ export interface CoreCourseModuleMainComponent {
* @param done Function to call when done.
* @return Promise resolved when done.
*/
doRefresh(refresher?: CustomEvent<IonRefresher>, done?: () => void): Promise<void>;
doRefresh(refresher?: IonRefresher, done?: () => void): Promise<void>;
}
/**

View File

@ -7,7 +7,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!coursesLoaded" (ionRefresh)="refreshCourses($event)">
<ion-refresher slot="fixed" [disabled]="!coursesLoaded" (ionRefresh)="refreshCourses($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="coursesLoaded">

View File

@ -62,7 +62,7 @@ export class CoreCoursesAvailableCoursesPage implements OnInit {
*
* @param refresher Refresher.
*/
refreshCourses(refresher: CustomEvent<IonRefresher>): void {
refreshCourses(refresher: IonRefresher): void {
const promises: Promise<void>[] = [];
promises.push(CoreCourses.invalidateUserCourses());
@ -70,7 +70,7 @@ export class CoreCoursesAvailableCoursesPage implements OnInit {
Promise.all(promises).finally(() => {
this.loadCourses().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
});
}

View File

@ -10,7 +10,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!categoriesLoaded" (ionRefresh)="refreshCategories($event)">
<ion-refresher slot="fixed" [disabled]="!categoriesLoaded" (ionRefresh)="refreshCategories($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="categoriesLoaded">

View File

@ -102,7 +102,7 @@ export class CoreCoursesCategoriesPage implements OnInit {
*
* @param refresher Refresher.
*/
refreshCategories(refresher?: CustomEvent<IonRefresher>): void {
refreshCategories(refresher?: IonRefresher): void {
const promises: Promise<void>[] = [];
promises.push(CoreCourses.invalidateUserCourses());
@ -112,7 +112,7 @@ export class CoreCoursesCategoriesPage implements OnInit {
Promise.all(promises).finally(() => {
this.fetchCategories().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
});
}

View File

@ -12,7 +12,7 @@
</core-context-menu>
</core-navbar-buttons>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshDashboard($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshDashboard($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -119,7 +119,7 @@ export class CoreCoursesDashboardPage implements OnInit, OnDestroy {
*
* @param refresher Refresher.
*/
refreshDashboard(refresher: CustomEvent<IonRefresher>): void {
refreshDashboard(refresher: IonRefresher): void {
const promises: Promise<void>[] = [];
promises.push(CoreCoursesDashboard.invalidateDashboardBlocks());
@ -133,7 +133,7 @@ export class CoreCoursesDashboardPage implements OnInit, OnDestroy {
Promise.all(promises).finally(() => {
this.loadContent().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
});
}

View File

@ -25,7 +25,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!coursesLoaded" (ionRefresh)="refreshCourses($event)">
<ion-refresher slot="fixed" [disabled]="!coursesLoaded" (ionRefresh)="refreshCourses($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -122,7 +122,7 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
*
* @param refresher Refresher.
*/
refreshCourses(refresher: CustomEvent<IonRefresher>): void {
refreshCourses(refresher: IonRefresher): void {
const promises: Promise<void>[] = [];
promises.push(CoreCourses.invalidateUserCourses());
@ -133,7 +133,7 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
Promise.all(promises).finally(() => {
this.fetchCourses().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
});
}

View File

@ -16,7 +16,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!settingsLoaded || isMinor" (ionRefresh)="refreshSettings($event)">
<ion-refresher slot="fixed" [disabled]="!settingsLoaded || isMinor" (ionRefresh)="refreshSettings($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -257,9 +257,9 @@ export class CoreLoginEmailSignupPage implements OnInit {
*
* @param event Event.
*/
refreshSettings(event?: CustomEvent<IonRefresher>): void {
refreshSettings(event?: IonRefresher): void {
this.fetchData().finally(() => {
event?.detail.complete();
event?.complete();
});
}

View File

@ -10,7 +10,7 @@
</ion-header>
<ion-content>
<core-split-view>
<ion-refresher slot="fixed" [disabled]="!handlers.loaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!handlers.loaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="handlers.loaded">

View File

@ -152,9 +152,9 @@ export class CoreSitePreferencesPage implements AfterViewInit, OnDestroy {
*
* @param refresher Refresher.
*/
refreshData(refresher?: CustomEvent<IonRefresher>): void {
refreshData(refresher?: IonRefresher): void {
this.fetchData().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
}

View File

@ -14,7 +14,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher [disabled]="!loaded" (ionRefresh)="refreshData($event)" slot="fixed">
<ion-refresher [disabled]="!loaded" (ionRefresh)="refreshData($event.target)" slot="fixed">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="loaded">

View File

@ -104,9 +104,9 @@ export class CoreSettingsSpaceUsagePage implements OnInit, OnDestroy {
*
* @param event Refresher event.
*/
refreshData(event?: CustomEvent<IonRefresher>): void {
refreshData(refresher?: IonRefresher): void {
this.loadSiteData().finally(() => {
event?.detail.complete();
refresher?.complete();
});
}

View File

@ -12,8 +12,7 @@
</core-context-menu>
</core-navbar-buttons>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!dataLoaded"
(ionRefresh)="doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!dataLoaded" (ionRefresh)="doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-block-course-blocks [courseId]="siteHomeId" [downloadEnabled]="downloadEnabled">

View File

@ -154,7 +154,7 @@ export class CoreSiteHomeIndexPage implements OnInit, OnDestroy {
*
* @param refresher Refresher.
*/
doRefresh(refresher?: CustomEvent<IonRefresher>): void {
doRefresh(refresher?: IonRefresher): void {
const promises: Promise<unknown>[] = [];
promises.push(CoreCourse.invalidateSections(this.siteHomeId!));
@ -184,7 +184,7 @@ export class CoreSiteHomeIndexPage implements OnInit, OnDestroy {
}
await Promise.all(p2).finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
});
}

View File

@ -97,7 +97,7 @@ export class CoreSitePluginsCourseFormatComponent implements OnChanges {
* @param afterCompletionChange Whether the refresh is due to a completion change.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher>, done?: () => void, afterCompletionChange?: boolean): Promise<void> {
async doRefresh(refresher?: IonRefresher, done?: () => void, afterCompletionChange?: boolean): Promise<void> {
await this.content?.refreshContent(afterCompletionChange);
}

View File

@ -124,7 +124,7 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C
* @param done Function to call when done.
* @return Promise resolved when done.
*/
async doRefresh(refresher?: CustomEvent<IonRefresher> | null, done?: () => void): Promise<void> {
async doRefresh(refresher?: IonRefresher | null, done?: () => void): Promise<void> {
if (this.content) {
this.refreshIcon = CoreConstants.ICON_LOADING;
}
@ -132,7 +132,7 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C
try {
await this.content?.refreshContent(false);
} finally {
refresher?.detail.complete();
refresher?.complete();
done && done();
}
}

View File

@ -9,7 +9,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="loaded">

View File

@ -13,7 +13,7 @@
// limitations under the License.
import { Component, OnInit, Type } from '@angular/core';
import { IonInfiniteScroll, IonRefresher } from '@ionic/angular';
import { IonRefresher } from '@ionic/angular';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreTag } from '@features/tag/services/tag';
import { ActivatedRoute } from '@angular/router';
@ -140,11 +140,11 @@ export class CoreTagIndexAreaPage implements OnInit {
* @param infiniteComplete Infinite scroll complete function.
* @return Resolved when done.
*/
async loadMore(infiniteComplete?: CustomEvent<IonInfiniteScroll>): Promise<void> {
async loadMore(infiniteComplete?: () => void): Promise<void> {
try {
await this.fetchData();
} finally {
infiniteComplete?.detail.complete();
infiniteComplete?.();
}
}
@ -153,7 +153,7 @@ export class CoreTagIndexAreaPage implements OnInit {
*
* @param refresher Refresher.
*/
async refreshData(refresher?: CustomEvent<IonRefresher>): Promise<void> {
async refreshData(refresher?: IonRefresher): Promise<void> {
try {
await CoreTag.invalidateTagIndexPerArea(
this.tagId,
@ -168,7 +168,7 @@ export class CoreTagIndexAreaPage implements OnInit {
try {
await this.fetchData(true);
} finally {
refresher?.detail.complete();
refresher?.complete();
}
}
}

View File

@ -9,7 +9,7 @@
<ion-content>
<core-split-view>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="loaded">

View File

@ -121,7 +121,7 @@ export class CoreTagIndexPage implements OnInit {
*
* @param refresher Refresher.
*/
refreshData(refresher?: CustomEvent<IonRefresher>): void {
refreshData(refresher?: IonRefresher): void {
CoreTag.invalidateTagIndexPerArea(
this.tagId,
this.tagName,
@ -132,7 +132,7 @@ export class CoreTagIndexPage implements OnInit {
this.recursive,
).finally(() => {
this.fetchData().finally(() => {
refresher?.detail.complete();
refresher?.complete();
});
});
}

View File

@ -7,7 +7,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event)">
<ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshData($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<ion-grid class="safe-area-page">

View File

@ -103,12 +103,12 @@ export class CoreTagSearchPage implements OnInit {
*
* @param refresher Refresher event.
*/
refreshData(refresher?: CustomEvent<IonRefresher>): void {
refreshData(refresher?: IonRefresher): void {
CoreUtils.allPromises([
CoreTag.invalidateTagCollections(),
CoreTag.invalidateTagCloud(this.collectionId, undefined, undefined, this.query),
]).finally(() => this.fetchData().finally(() => {
refresher?.detail.complete();
refresher?.complete();
}));
}

View File

@ -7,7 +7,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!userLoaded" (ionRefresh)="refreshUser($event)">
<ion-refresher slot="fixed" [disabled]="!userLoaded" (ionRefresh)="refreshUser($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="userLoaded">

View File

@ -94,12 +94,12 @@ export class CoreUserAboutPage implements OnInit {
* @param event Event.
* @return Promise resolved when done.
*/
async refreshUser(event?: CustomEvent<IonRefresher>): Promise<void> {
async refreshUser(event?: IonRefresher): Promise<void> {
await CoreUtils.ignoreErrors(CoreUser.invalidateUserCache(this.userId));
await this.fetchUser();
event?.detail.complete();
event?.complete();
if (this.user) {
CoreEvents.trigger(CoreUserProvider.PROFILE_REFRESHED, {

View File

@ -6,7 +6,8 @@
<ion-content>
<core-split-view>
<ion-refresher slot="fixed" [disabled]="!participants.loaded || searchInProgress" (ionRefresh)="refreshParticipants($event.target)">
<ion-refresher slot="fixed" [disabled]="!participants.loaded || searchInProgress"
(ionRefresh)="refreshParticipants($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
@ -17,16 +18,18 @@
</core-search-box>
<core-loading [hideUntil]="participants.loaded">
<core-empty-box *ngIf="participants.empty && !searchInProgress && !searchQuery" icon="person" [message]="'core.user.noparticipants' | translate">
<core-empty-box *ngIf="participants.empty && !searchInProgress && !searchQuery" icon="person"
[message]="'core.user.noparticipants' | translate">
</core-empty-box>
<core-empty-box *ngIf="participants.empty && !searchInProgress && searchQuery" icon="search" [message]="'core.noresults' | translate">
<core-empty-box *ngIf="participants.empty && !searchInProgress && searchQuery" icon="search"
[message]="'core.noresults' | translate">
</core-empty-box>
<ion-list *ngIf="!participants.empty">
<ion-item *ngFor="let participant of participants.items"
class="ion-text-wrap" [class.core-selected-item]="participants.isSelected(participant)" [title]="participant.fullname"
(click)="participants.select(participant)">
class="ion-text-wrap" [class.core-selected-item]="participants.isSelected(participant)"
[title]="participant.fullname" (click)="participants.select(participant)">
<core-user-avatar [user]="participant" [linkProfile]="false" [checkOnline]="true" slot="start">
</core-user-avatar>
@ -34,20 +37,28 @@
<ion-label>
<ng-container *ngIf="!searchQuery">
<h2>{{ participant.fullname }}</h2>
<p *ngIf="participant.lastcourseaccess"><strong>{{ 'core.lastaccess' | translate }}: </strong>{{ participant.lastcourseaccess | coreTimeAgo }}</p>
<p *ngIf="!participant.lastcourseaccess && participant.lastaccess"><strong>{{ 'core.lastaccess' | translate }}: </strong>{{ participant.lastaccess | coreTimeAgo }}</p>
<p *ngIf="participant.lastcourseaccess">
<strong>{{ 'core.lastaccess' | translate }}: </strong>
{{ participant.lastcourseaccess | coreTimeAgo }}
</p>
<p *ngIf="!participant.lastcourseaccess && participant.lastaccess">
<strong>{{ 'core.lastaccess' | translate }}: </strong>
{{ participant.lastaccess | coreTimeAgo }}
</p>
</ng-container>
<ng-container *ngIf="searchQuery">
<h2>
<core-format-text [text]="participant.fullname" [highlight]="searchQuery" [filter]="false"></core-format-text>
<core-format-text [text]="participant.fullname" [highlight]="searchQuery" [filter]="false">
</core-format-text>
</h2>
</ng-container>
</ion-label>
</ion-item>
</ion-list>
<core-infinite-loading [enabled]="participants.loaded && !participants.completed" (action)="fetchMoreParticipants($event)" [error]="fetchMoreParticipantsFailed">
<core-infinite-loading [enabled]="participants.loaded && !participants.completed"
(action)="fetchMoreParticipants($event)" [error]="fetchMoreParticipantsFailed">
</core-infinite-loading>
</core-loading>
</core-split-view>

View File

@ -7,7 +7,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!userLoaded" (ionRefresh)="refreshUser($event)">
<ion-refresher slot="fixed" [disabled]="!userLoaded" (ionRefresh)="refreshUser($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="userLoaded">

View File

@ -235,7 +235,7 @@ export class CoreUserProfilePage implements OnInit, OnDestroy {
* @param event Event.
* @return Promise resolved when done.
*/
async refreshUser(event?: CustomEvent<IonRefresher>): Promise<void> {
async refreshUser(event?: IonRefresher): Promise<void> {
await CoreUtils.ignoreErrors(Promise.all([
CoreUser.invalidateUserCache(this.userId),
CoreCourses.invalidateUserNavigationOptions(),
@ -244,7 +244,7 @@ export class CoreUserProfilePage implements OnInit, OnDestroy {
await this.fetchUser();
event?.detail.complete();
event?.complete();
if (this.user) {
CoreEvents.trigger(CoreUserProvider.PROFILE_REFRESHED, {