Skip to content

Commit

Permalink
fix: theme logo
Browse files Browse the repository at this point in the history
  • Loading branch information
kim.tran committed Dec 5, 2023
1 parent 2e5ce95 commit e8ebc0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export class PortalViewportComponent implements OnInit, AfterViewInit, OnDestroy

this.themeService.currentTheme$.pipe(untilDestroyed(this)).subscribe((theme: any) => {
this.logoUrl = theme.logoUrl || this.portalDefinition.logoUrl
if (this.logoUrl && !this.logoUrl.startsWith('/portal-api')) {
this.logoUrl = '/portal-api' + this.logoUrl
}
document.getElementById('favicon')?.setAttribute('href', theme.faviconUrl)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export class ThemeService implements OnDestroy {
return this.http.get<Theme>(`${this.baseUrlV1}/internal/themes/${encodeURI(themeName)}`).pipe(
tap((theme) => {
this.apply(theme)
this.currentTheme$.publish(theme)
})
)
}

public apply(theme: Theme) {
console.log(`🎨 Applying theme: ${theme.name}`)
this.currentTheme$.publish(theme)
if (theme.properties) {
Object.values(theme.properties).forEach((group) => {
for (const [key, value] of Object.entries(group)) {
Expand Down

0 comments on commit e8ebc0e

Please sign in to comment.