Skip to content

Commit 44a961e

Browse files
fix: Safe check for theme (#354)
Co-authored-by: tumms2021389 <[email protected]>
1 parent d19290a commit 44a961e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

projects/angular-test-app/src/app/_samples/embedded/embedded.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class EmbeddedComponent implements OnInit, OnDestroy {
6565

6666
const { authConfig, theme } = await getSdkConfig();
6767
document.body.classList.remove(...['light', 'dark']);
68-
document.body.classList.add(theme);
68+
document.body.classList.add(theme || 'dark');
6969
initializeAuthentication(authConfig);
7070

7171
// Login if needed, without doing an initial main window redirect

projects/angular-test-app/src/app/_samples/full-portal/full-portal.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class FullPortalComponent implements OnInit, OnDestroy {
5050
async ngOnInit() {
5151
const { theme } = await this.scservice.readSdkConfig();
5252
document.body.classList.remove(...['light', 'dark']);
53-
document.body.classList.add(theme);
53+
document.body.classList.add(theme || 'dark');
5454
this.initialize();
5555
}
5656

0 commit comments

Comments
 (0)