From df81617588b0be28e8ee7ead79de05fad45c5f81 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 19 Oct 2023 16:14:02 +0200 Subject: [PATCH 1/2] MOBILE-4362 siteplugins: Add helper function to update cached data --- .../components/plugin-content/plugin-content.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 = { From f8fe8aee36fef87d74de00537c9e4bb4f5711127 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 20 Oct 2023 13:26:49 +0200 Subject: [PATCH 2/2] MOBILE-4362 course: Format course name in storage page --- .../storagemanager/pages/course-storage/course-storage.html | 5 ++++- .../pages/courses-storage/courses-storage.html | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/addons/storagemanager/pages/course-storage/course-storage.html b/src/addons/storagemanager/pages/course-storage/course-storage.html index c780b641b..0c90b2fb4 100644 --- a/src/addons/storagemanager/pages/course-storage/course-storage.html +++ b/src/addons/storagemanager/pages/course-storage/course-storage.html @@ -19,7 +19,10 @@ - {{ title }} + + + +

{{ 'addon.storagemanager.totaldownloads' | translate }}

diff --git a/src/addons/storagemanager/pages/courses-storage/courses-storage.html b/src/addons/storagemanager/pages/courses-storage/courses-storage.html index 2cbcb21e9..b7692ea14 100644 --- a/src/addons/storagemanager/pages/courses-storage/courses-storage.html +++ b/src/addons/storagemanager/pages/courses-storage/courses-storage.html @@ -45,7 +45,10 @@ -

{{ course.title }}

+

+ + +

{{ 'core.downloading' | translate }}