Skip to content

Commit

Permalink
fix bug in ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
EverettSummer committed Jul 28, 2024
1 parent d15f92e commit 116f877
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deneb-ui",
"version": "4.1.0",
"version": "4.1.1",
"scripts": {
"ng": "ng",
"start": "ng serve --project Deneb-UI-Demo",
Expand Down
2 changes: 1 addition & 1 deletion projects/irohalab/deneb-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@irohalab/deneb-ui",
"version": "4.1.0",
"version": "4.1.1",
"description": "Building blocks for mira-ui",
"author": "Everett Summer",
"license": "Apache-2.0",
Expand Down
6 changes: 4 additions & 2 deletions projects/irohalab/deneb-ui/src/dark-theme.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class DarkThemeService implements OnDestroy {
return this._themeChangeSubject.asObservable();
}

constructor(@Inject(PLATFORM_ID) platformId: object) {
constructor(@Inject(PLATFORM_ID) private platformId: object) {
if (isPlatformBrowser(platformId)) {
this.checkTheme();
this.initGlobalListener();
Expand All @@ -37,7 +37,9 @@ export class DarkThemeService implements OnDestroy {
}

public ngOnDestroy(): void {
window.removeEventListener(EVENT_NAME, this._globalListenerInstance);
if (isPlatformBrowser(this.platformId)) {
window.removeEventListener(EVENT_NAME, this._globalListenerInstance);
}
}

private initGlobalListener(): void {
Expand Down

0 comments on commit 116f877

Please sign in to comment.