MOBILE-4437 icon: Check branded icons checking filtericon url param

main
Pau Ferrer Ocaña 2024-04-11 11:41:31 +02:00
parent fb1600aa66
commit 7f0ceb5c7a
1 changed files with 4 additions and 3 deletions

View File

@ -92,7 +92,6 @@ export class CoreModIconComponent implements OnInit, OnChanges {
this.modNameTranslated = CoreCourse.translateModuleName(this.modname, this.fallbackTranslation); this.modNameTranslated = CoreCourse.translateModuleName(this.modname, this.fallbackTranslation);
this.setIsBranded();
this.setPurposeClass(); this.setPurposeClass();
await this.setIcon(); await this.setIcon();
@ -113,7 +112,7 @@ export class CoreModIconComponent implements OnInit, OnChanges {
* @returns wether the icon does not need to be filtered. * @returns wether the icon does not need to be filtered.
*/ */
protected async setIsBranded(): Promise<void> { protected async setIsBranded(): Promise<void> {
if (!this.colorize || this.isBranded !== undefined) { if (!this.colorize) {
// It doesn't matter. // It doesn't matter.
return; return;
} }
@ -127,7 +126,6 @@ export class CoreModIconComponent implements OnInit, OnChanges {
// No icon or local icon (not legacy), colorize it. // No icon or local icon (not legacy), colorize it.
if (!this.iconUrl || this.isLocalUrl) { if (!this.iconUrl || this.isLocalUrl) {
// Exception for bigbluebuttonbn, it's the only one that has a branded icon. // Exception for bigbluebuttonbn, it's the only one that has a branded icon.
if (this.iconVersion === IconVersion.VERSION_4_0 && this.modname === 'bigbluebuttonbn') { if (this.iconVersion === IconVersion.VERSION_4_0 && this.modname === 'bigbluebuttonbn') {
this.isBranded = true; this.isBranded = true;
@ -174,6 +172,7 @@ export class CoreModIconComponent implements OnInit, OnChanges {
if (!this.iconUrl) { if (!this.iconUrl) {
this.loadFallbackIcon(); this.loadFallbackIcon();
this.setIsBranded();
return; return;
} }
@ -189,6 +188,8 @@ export class CoreModIconComponent implements OnInit, OnChanges {
!this.isLocalUrl && !this.isLocalUrl &&
this.getComponentNameFromIconUrl(this.iconUrl) != this.modname; this.getComponentNameFromIconUrl(this.iconUrl) != this.modname;
this.setIsBranded();
await this.setSVGIcon(); await this.setSVGIcon();
} }