fix(console): change console favicon (#7366)

* feat: initial favicon poc

* feat: reload page if icons changed and we apply config

---------

Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
Miguel Cabrerizo
2024-02-14 08:38:53 +00:00
committed by GitHub
co-authored by Max Peintner
parent f6995fcb6c
commit 4789734946
3 changed files with 41 additions and 4 deletions
@@ -87,6 +87,7 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
public refreshPreview: EventEmitter<void> = new EventEmitter();
public org!: Org.AsObject;
public InfoSectionType: any = InfoSectionType;
private iconChanged: boolean = false;
private destroy$: Subject<void> = new Subject();
public view: View = View.PREVIEW;
@@ -265,6 +266,7 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
return previewHandler(this.service.removeLabelPolicyLogo());
}
} else if (type === AssetType.ICON) {
this.iconChanged = true;
if (theme === Theme.DARK) {
return previewHandler(this.service.removeLabelPolicyIconDark());
} else if (theme === Theme.LIGHT) {
@@ -300,6 +302,7 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
return previewHandler(this.service.removeLabelPolicyLogo());
}
} else if (type === AssetType.ICON) {
this.iconChanged = true;
if (theme === Theme.DARK) {
return previewHandler(this.service.removeLabelPolicyIconDark());
} else if (theme === Theme.LIGHT) {
@@ -348,6 +351,7 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
break;
}
}
this.iconChanged = true;
}
}
}
@@ -647,6 +651,10 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
.then(() => {
this.toast.showInfo('POLICY.PRIVATELABELING.ACTIVATED', true);
setTimeout(() => {
if (this.iconChanged) {
this.iconChanged = false;
window.location.reload();
}
this.getData().then((data) => {
if (data.policy) {
this.data = data.policy;
@@ -668,6 +676,10 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
.then(() => {
this.toast.showInfo('POLICY.PRIVATELABELING.ACTIVATED', true);
setTimeout(() => {
if (this.iconChanged) {
this.iconChanged = false;
window.location.reload();
}
this.getData().then((data) => {
if (data.policy) {
this.data = data.policy;