From 70994ca4f5d74b08f1e86d8e744dbae1f7d59b2e Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 25 Mar 2024 12:52:24 +0100 Subject: [PATCH] MOBILE-4551 sync: Display toast when site sync is successful --- scripts/langindex.json | 1 + src/core/features/settings/lang.json | 1 + src/core/features/settings/pages/site/site.ts | 2 ++ .../features/settings/pages/synchronization/synchronization.ts | 2 ++ 4 files changed, 6 insertions(+) diff --git a/scripts/langindex.json b/scripts/langindex.json index dd05ecdc9..7e8e452d6 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -2493,6 +2493,7 @@ "core.settings.showdownloadoptions": "local_moodlemobileapp", "core.settings.siteinfo": "local_moodlemobileapp", "core.settings.sites": "moodle", + "core.settings.sitesynccompleted": "local_moodlemobileapp", "core.settings.sitesyncfailed": "local_moodlemobileapp", "core.settings.spaceusage": "local_moodlemobileapp", "core.settings.syncdatasaver": "local_moodlemobileapp", diff --git a/src/core/features/settings/lang.json b/src/core/features/settings/lang.json index 5af24834b..830cb542f 100644 --- a/src/core/features/settings/lang.json +++ b/src/core/features/settings/lang.json @@ -71,6 +71,7 @@ "showdownloadoptions": "Show download options", "siteinfo": "Site info", "sites": "Sites", + "sitesynccompleted": "Site synchronisation completed.", "sitesyncfailed": "Site synchronisation failed", "spaceusage": "Space usage", "syncdatasaver": "Data saver: Synchronise only when on Wi-Fi", diff --git a/src/core/features/settings/pages/site/site.ts b/src/core/features/settings/pages/site/site.ts index 847054437..32c0afa5f 100644 --- a/src/core/features/settings/pages/site/site.ts +++ b/src/core/features/settings/pages/site/site.ts @@ -116,6 +116,8 @@ export class CoreSitePreferencesPage implements AfterViewInit, OnDestroy { try { // Using syncOnlyOnWifi false to force manual sync. await CoreSettingsHelper.synchronizeSite(false, this.siteId); + + CoreDomUtils.showToast('core.settings.sitesynccompleted', true); } catch (error) { if (this.isDestroyed) { return; diff --git a/src/core/features/settings/pages/synchronization/synchronization.ts b/src/core/features/settings/pages/synchronization/synchronization.ts index ad04dc355..2bf02cdbf 100644 --- a/src/core/features/settings/pages/synchronization/synchronization.ts +++ b/src/core/features/settings/pages/synchronization/synchronization.ts @@ -131,6 +131,8 @@ export class CoreSettingsSynchronizationPage implements OnInit, OnDestroy { // Using syncOnlyOnWifi false to force manual sync. try { await CoreSettingsHelper.synchronizeSite(false, siteId); + + CoreDomUtils.showToast('core.settings.sitesynccompleted', true); } catch (error) { if (this.isDestroyed) { return;