From d6de0de61dd9bf413b3a4aeee7449c6d7249f450 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 19 Mar 2024 19:53:32 +0100 Subject: [PATCH] Refactoring --- apps/client/src/app/app.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/client/src/app/app.component.ts b/apps/client/src/app/app.component.ts index 8d6390f02..1cf10bab6 100644 --- a/apps/client/src/app/app.component.ts +++ b/apps/client/src/app/app.component.ts @@ -201,12 +201,15 @@ export class AppComponent implements OnDestroy, OnInit { const themeColor = getCssVariable( isDarkTheme ? '--dark-background' : '--light-background' ); - const metaTag = this.document.querySelector('meta[name="theme-color"]'); + if (isDarkTheme) { this.document.body.classList.add('is-dark-theme'); } else { this.document.body.classList.remove('is-dark-theme'); } - metaTag.setAttribute('content', themeColor); + + this.document + .querySelector('meta[name="theme-color"]') + .setAttribute('content', themeColor); } }