Merge pull request #3224 from dpalou/MOBILE-3919
MOBILE-3919 assign: Dismiss toast when leaving page
This commit is contained in:
		
						commit
						1f97e94972
					
				| @ -73,6 +73,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave { | |||||||
|     protected hasOffline = false; // Whether the assignment has offline data.
 |     protected hasOffline = false; // Whether the assignment has offline data.
 | ||||||
|     protected isDestroyed = false; // Whether the component has been destroyed.
 |     protected isDestroyed = false; // Whether the component has been destroyed.
 | ||||||
|     protected forceLeave = false; // To allow leaving the page without checking for changes.
 |     protected forceLeave = false; // To allow leaving the page without checking for changes.
 | ||||||
|  |     protected timeUpToast?: HTMLIonToastElement; | ||||||
| 
 | 
 | ||||||
|     constructor( |     constructor( | ||||||
|         protected route: ActivatedRoute, |         protected route: ActivatedRoute, | ||||||
| @ -463,8 +464,8 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave { | |||||||
|     /** |     /** | ||||||
|      * Function called when the time is up. |      * Function called when the time is up. | ||||||
|      */ |      */ | ||||||
|     timeUp(): void { |     async timeUp(): Promise<void> { | ||||||
|         CoreDomUtils.showToastWithOptions({ |         this.timeUpToast = await CoreDomUtils.showToastWithOptions({ | ||||||
|             message: Translate.instant('addon.mod_assign.caneditsubmission'), |             message: Translate.instant('addon.mod_assign.caneditsubmission'), | ||||||
|             duration: 0, |             duration: 0, | ||||||
|             buttons: [Translate.instant('core.dismiss')], |             buttons: [Translate.instant('core.dismiss')], | ||||||
| @ -477,6 +478,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave { | |||||||
|      */ |      */ | ||||||
|     ngOnDestroy(): void { |     ngOnDestroy(): void { | ||||||
|         this.isDestroyed = true; |         this.isDestroyed = true; | ||||||
|  |         this.timeUpToast?.dismiss(); | ||||||
| 
 | 
 | ||||||
|         // Unblock the assignment.
 |         // Unblock the assignment.
 | ||||||
|         if (this.assign) { |         if (this.assign) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user