From 2469d903a73ac6f337b139b3e7d2187e0d7cf9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 8 Mar 2019 10:24:08 +0100 Subject: [PATCH] MOBILE-2873 blog: Show blog icon on the tab bar if needed --- src/core/course/providers/sync.ts | 15 ++++++++++----- src/core/mainmenu/pages/menu/menu.scss | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/core/course/providers/sync.ts b/src/core/course/providers/sync.ts index 887eaa1c0..2c091a863 100644 --- a/src/core/course/providers/sync.ts +++ b/src/core/course/providers/sync.ts @@ -49,19 +49,21 @@ export class CoreCourseSyncProvider extends CoreSyncBaseProvider { * Try to synchronize all the courses in a certain site or in all sites. * * @param {string} [siteId] Site ID to sync. If not defined, sync all sites. + * @param {boolean} [force] Wether the execution is forced (manual sync). * @return {Promise} Promise resolved if sync is successful, rejected if sync fails. */ - syncAllCourses(siteId?: string): Promise { - return this.syncOnSites('courses', this.syncAllCoursesFunc.bind(this), undefined, siteId); + syncAllCourses(siteId?: string, force?: boolean): Promise { + return this.syncOnSites('courses', this.syncAllCoursesFunc.bind(this), [force], siteId); } /** * Sync all courses on a site. * - * @param {string} [siteId] Site ID to sync. If not defined, sync all sites. + * @param {string} siteId Site ID to sync. If not defined, sync all sites. + * @param {boolean} force Wether the execution is forced (manual sync). * @return {Promise} Promise resolved if sync is successful, rejected if sync fails. */ - protected syncAllCoursesFunc(siteId?: string): Promise { + protected syncAllCoursesFunc(siteId: string, force: boolean): Promise { const p1 = []; p1.push(this.logHelper.syncSite(siteId)); @@ -69,7 +71,10 @@ export class CoreCourseSyncProvider extends CoreSyncBaseProvider { p1.push(this.courseOffline.getAllManualCompletions(siteId).then((completions) => { // Sync all courses. const p2 = completions.map((completion) => { - return this.syncCourseIfNeeded(completion.courseid, siteId).then((result) => { + const promise = force ? this.syncCourse(completion.courseid, siteId) : + this.syncCourseIfNeeded(completion.courseid, siteId); + + return promise.then((result) => { if (result && result.updated) { // Sync successful, send event. this.eventsProvider.trigger(CoreCourseSyncProvider.AUTO_SYNCED, { diff --git a/src/core/mainmenu/pages/menu/menu.scss b/src/core/mainmenu/pages/menu/menu.scss index 2fa0db196..5b532fcb8 100644 --- a/src/core/mainmenu/pages/menu/menu.scss +++ b/src/core/mainmenu/pages/menu/menu.scss @@ -17,4 +17,20 @@ ion-app.app-root page-core-mainmenu { font-size: 23px; height: 23px; } + + .ion-md-fa-newspaper-o, + .ion-ios-fa-newspaper-o, + .ion-ios-fa-newspaper-o-outline, + .ion-wp-fa-newspaper-o, + .ion-fa-newspaper-o { + @extend .fa-newspaper-o; + @extend .fa; + font-size: 22px; + height: 22px; + } + + .ion-ios-fa-newspaper-o-outline { + font-size: 23px; + height: 23px; + } }