From b4e7f35372164001af1b522d447822bd42699014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 4 Jun 2024 14:08:07 +0200 Subject: [PATCH] MOBILE-4470 icon: Add a forced exception for BBB on version 4.0 --- src/core/components/mod-icon/mod-icon.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/core/components/mod-icon/mod-icon.ts b/src/core/components/mod-icon/mod-icon.ts index 0bb66e0b0..0f693cdc7 100644 --- a/src/core/components/mod-icon/mod-icon.ts +++ b/src/core/components/mod-icon/mod-icon.ts @@ -134,27 +134,31 @@ export class CoreModIconComponent implements OnInit, OnChanges { // Reset the branded class to the original value. this.brandedClass = this.isBranded; + // Exception for bigbluebuttonbn, it's the only one that has a branded icon. + if (this.iconVersion === IconVersion.VERSION_4_0 && this.modname === 'bigbluebuttonbn') { + // Known issue, if the icon is overriden by theme it won't be colorized. + this.brandedClass = true; + + return; + } + // No icon or local icon (not legacy), colorize it. if (!this.iconUrl() || this.isLocalUrl()) { - // Exception for bigbluebuttonbn, it's the only one that has a branded icon. - if (this.iconVersion === IconVersion.VERSION_4_0 && this.modname === 'bigbluebuttonbn') { - this.brandedClass = true; - - return; - } - this.brandedClass ??= false; return; } this.iconUrl.update(value => CoreTextUtils.decodeHTMLEntities(value)); + if (this.brandedClass !== undefined) { + return; + } // If it's an Moodle Theme icon, check if filtericon is set and use it. if (CoreUrlUtils.isThemeImageUrl(this.iconUrl())) { const filter = CoreUrlUtils.getThemeImageUrlParam(this.iconUrl(), 'filtericon'); if (filter === '1') { - this.brandedClass = false; + this.brandedClass = false; return; }