forked from EVOgeek/Vmeda.Online
		
	Merge pull request #3365 from dpalou/MOBILE-3978
MOBILE-3978 calendar: Add fallback for access info
This commit is contained in:
		
						commit
						302a4bc821
					
				| @ -160,14 +160,20 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | ||||
|      * @return Promise resolved when done. | ||||
|      */ | ||||
|     protected async fetchData(): Promise<void> { | ||||
|         let accessInfo: AddonCalendarGetCalendarAccessInformationWSResponse; | ||||
| 
 | ||||
|         this.error = false; | ||||
| 
 | ||||
|         // Get access info.
 | ||||
|         try { | ||||
|             accessInfo = await AddonCalendar.getAccessInformation(this.courseId); | ||||
|             this.types = await AddonCalendar.getAllowedEventTypes(this.courseId); | ||||
|             const [types, accessInfo] = await Promise.all([ | ||||
|                 AddonCalendar.getAllowedEventTypes(this.courseId), | ||||
|                 CoreUtils.ignoreErrors(AddonCalendar.getAccessInformation(this.courseId), { | ||||
|                     canmanageentries: false, | ||||
|                     canmanageownentries: false, | ||||
|                     canmanagegroupentries: false, | ||||
|                 } as AddonCalendarGetCalendarAccessInformationWSResponse), | ||||
|             ]); | ||||
| 
 | ||||
|             this.types = types; | ||||
| 
 | ||||
|             const promises: Promise<void>[] = []; | ||||
|             const eventTypes = AddonCalendarHelper.getEventTypeOptions(this.types); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user