MOBILE-3213 workshop: Disable refreshers when inform
parent
bed497d54d
commit
7a1b49cae1
|
@ -154,6 +154,7 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity
|
|||
promises.push(this.workshopProvider.invalidateReviewerAssesmentsData(this.workshop.id));
|
||||
}
|
||||
promises.push(this.workshopProvider.invalidateGradesData(this.workshop.id));
|
||||
promises.push(this.workshopProvider.invalidateWorkshopWSData(this.workshop.id));
|
||||
}
|
||||
|
||||
return Promise.all(promises);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-refresher [enabled]="loaded" (ionRefresh)="refreshAssessment($event)">
|
||||
<ion-refresher [enabled]="loaded" (ionRefresh)="refreshAssessment($event)" *ngIf="!evaluating">
|
||||
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<core-loading [hideUntil]="loaded">
|
||||
|
|
|
@ -9,9 +9,6 @@
|
|||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-refresher [enabled]="loaded" (ionRefresh)="refreshSubmission($event)">
|
||||
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<core-loading [hideUntil]="loaded">
|
||||
<form ion-list [formGroup]="editForm" *ngIf="workshop">
|
||||
<ion-item text-wrap>
|
||||
|
|
|
@ -274,26 +274,6 @@ export class AddonModWorkshopEditSubmissionPage implements OnInit, OnDestroy {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pull to refresh.
|
||||
*
|
||||
* @param refresher Refresher.
|
||||
*/
|
||||
refreshSubmission(refresher: any): void {
|
||||
if (this.loaded) {
|
||||
const promises = [];
|
||||
|
||||
promises.push(this.workshopProvider.invalidateSubmissionData(this.workshopId, this.submission.id));
|
||||
promises.push(this.workshopProvider.invalidateSubmissionsData(this.workshopId));
|
||||
|
||||
Promise.all(promises).finally(() => {
|
||||
return this.fetchSubmissionData();
|
||||
}).finally(() => {
|
||||
refresher.complete();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the submission.
|
||||
*/
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-refresher [enabled]="loaded" (ionRefresh)="refreshSubmission($event)">
|
||||
<ion-refresher [enabled]="loaded" (ionRefresh)="refreshSubmission($event)" *ngIf="!((assessmentId && access.assessingallowed) || canAddFeedback)">
|
||||
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<core-loading [hideUntil]="loaded">
|
||||
|
|
|
@ -373,6 +373,10 @@ export class AddonModWorkshopSubmissionPage implements OnInit, OnDestroy {
|
|||
promises.push(this.workshopProvider.invalidateAssessmentData(this.workshopId, this.assessmentId));
|
||||
}
|
||||
|
||||
if (this.assessmentUserId) {
|
||||
promises.push(this.workshopProvider.invalidateReviewerAssesmentsData(this.workshopId, this.assessmentId));
|
||||
}
|
||||
|
||||
return Promise.all(promises).finally(() => {
|
||||
this.eventsProvider.trigger(AddonModWorkshopProvider.ASSESSMENT_INVALIDATED, this.siteId);
|
||||
|
||||
|
|
Loading…
Reference in New Issue