diff --git a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts index 2bd56a959..9f40f08c5 100644 --- a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts +++ b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts @@ -22,6 +22,7 @@ import { CoreSitePlugins, CoreSitePluginsContent, CoreSitePluginsProvider } from import { CoreNavigator } from '@services/navigator'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreEvents } from '@singletons/events'; +import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; /** * Component to render a site plugin content. @@ -238,6 +239,19 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck { CoreEvents.trigger(CoreSitePluginsProvider.UPDATE_COURSE_CONTENT, { cmId, alreadyFetched }); } + /** + * Update this content stored in the app's cache. This function will not reload the view, it will only update the data stored + * in the device so it's updated for the next usage. If you want to update the view, please use refreshContent. + */ + async updateCachedContent(): Promise { + await CoreSitePlugins.getContent( + this.component, + this.method, + this.args, + CoreSites.getReadingStrategyPreSets(CoreSitesReadingStrategy.ONLY_NETWORK), + ); + } + } export type CoreSitePluginsPluginContentLoadedData = {