forked from CIT/Vmeda.Online
		
	Merge pull request #2120 from crazyserver/MOBILE-3174
MOBILE-3174 data: Update fields on PTR
This commit is contained in:
		
						commit
						7eaba1496c
					
				| @ -151,6 +151,7 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp | ||||
|             promises.push(this.dataProvider.invalidateDatabaseAccessInformationData(this.data.id)); | ||||
|             promises.push(this.groupsProvider.invalidateActivityGroupInfo(this.data.coursemodule)); | ||||
|             promises.push(this.dataProvider.invalidateEntriesData(this.data.id)); | ||||
|             promises.push(this.dataProvider.invalidateFieldsData(this.data.id)); | ||||
| 
 | ||||
|             if (this.hasComments) { | ||||
|                 this.eventsProvider.trigger(CoreCommentsProvider.REFRESH_COMMENTS_EVENT, { | ||||
|  | ||||
| @ -216,6 +216,7 @@ export class AddonModDataEntryPage implements OnDestroy { | ||||
|             promises.push(this.dataProvider.invalidateEntryData(this.data.id, this.entryId)); | ||||
|             promises.push(this.groupsProvider.invalidateActivityGroupInfo(this.data.coursemodule)); | ||||
|             promises.push(this.dataProvider.invalidateEntriesData(this.data.id)); | ||||
|             promises.push(this.dataProvider.invalidateFieldsData(this.data.id)); | ||||
| 
 | ||||
|             if (this.data.comments && this.entry && this.entry.id > 0 && this.commentsEnabled && this.comments) { | ||||
|                 // Refresh comments. Don't add it to promises because we don't want the comments fetch to block the entry fetch.
 | ||||
|  | ||||
| @ -830,6 +830,7 @@ export class AddonModDataProvider { | ||||
|             // Do not invalidate module data before getting module info, we need it!
 | ||||
|             ps.push(this.invalidateDatabaseData(courseId, siteId)); | ||||
|             ps.push(this.invalidateDatabaseWSData(data.id, siteId)); | ||||
|             ps.push(this.invalidateFieldsData(data.id, siteId)); | ||||
| 
 | ||||
|             return Promise.all(ps); | ||||
|         })); | ||||
| @ -865,6 +866,19 @@ export class AddonModDataProvider { | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Invalidates database fields data. | ||||
|      * | ||||
|      * @param dataId Data ID. | ||||
|      * @param siteId Site ID. If not defined, current site. | ||||
|      * @return Promise resolved when the data is invalidated. | ||||
|      */ | ||||
|     invalidateFieldsData(dataId: number, siteId?: string): Promise<any> { | ||||
|         return this.sitesProvider.getSite(siteId).then((site) => { | ||||
|             return site.invalidateWsCacheForKey(this.getFieldsCacheKey(dataId)); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Invalidate the prefetched files. | ||||
|      * | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user