diff --git a/libs/shell-core/assets/styles.scss b/libs/shell-core/assets/styles.scss new file mode 100644 index 00000000..f22fa5d2 --- /dev/null +++ b/libs/shell-core/assets/styles.scss @@ -0,0 +1,3 @@ +.layout-topbar-items > * { + margin: auto; + } \ No newline at end of file diff --git a/libs/shell-core/src/lib/components/portal-header/header.component.scss b/libs/shell-core/src/lib/components/portal-header/header.component.scss index a69d80d3..b5ac7c3f 100644 --- a/libs/shell-core/src/lib/components/portal-header/header.component.scss +++ b/libs/shell-core/src/lib/components/portal-header/header.component.scss @@ -14,7 +14,3 @@ color: var(--logo-color, #12abdb); fill: currentColor; } - -.layout-topbar-items > * { - margin: auto; -} \ No newline at end of file diff --git a/libs/shell-core/src/lib/components/portal-viewport/portal-viewport.component.ts b/libs/shell-core/src/lib/components/portal-viewport/portal-viewport.component.ts index 767d6e6a..02e71cce 100644 --- a/libs/shell-core/src/lib/components/portal-viewport/portal-viewport.component.ts +++ b/libs/shell-core/src/lib/components/portal-viewport/portal-viewport.component.ts @@ -10,7 +10,7 @@ import { UserService, } from '@onecx/angular-integration-interface' import { MessageService, PrimeNGConfig } from 'primeng/api' -import { BehaviorSubject, filter, first, map, mergeMap, of } from 'rxjs' +import { BehaviorSubject, filter, first, from, mergeMap, of } from 'rxjs' export const SHOW_CONTENT_PROVIDER = new InjectionToken('SHOW_CONTENT_PROVIDER') @@ -66,26 +66,22 @@ export class PortalViewportComponent implements OnInit, OnDestroy { | undefined) || this.colorScheme }) - this.themeService.currentTheme$.pipe( - first(), - mergeMap((theme) => { - const prefix = theme.faviconUrl && theme.faviconUrl.startsWith('/') ? '/shell-bff' : '' - return theme.faviconUrl - ? this.httpClient - .get(prefix + theme.faviconUrl, { responseType: 'blob' }) - .pipe(map((blob) => URL.createObjectURL(blob))) - : of('') - }) - ) - this.themeService.currentTheme$ .pipe( first(), mergeMap((theme) => { return theme.faviconUrl - ? this.httpClient - .get(theme.faviconUrl, { responseType: 'blob' }) - .pipe(map((blob) => URL.createObjectURL(blob))) + ? this.httpClient.get(theme.faviconUrl, { responseType: 'blob' }).pipe( + mergeMap((blob) => { + return from( + new Promise((resolve) => { + const reader = new FileReader() + reader.onload = (e) => resolve(e.target?.result) + reader.readAsDataURL(blob) + }) + ) + }) + ) : of('') }) ) @@ -96,9 +92,6 @@ export class PortalViewportComponent implements OnInit, OnDestroy { link.rel = 'icon' document.head.appendChild(link) } - link.onload = () => { - URL.revokeObjectURL(url) - } link.href = url }) }