diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e975c8248..94d2ceb62 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -95,7 +95,9 @@ export class AppComponent implements OnInit, OnDestroy { const toRemove = Array.from(classList).filter((item: string) => item.includes('-theme') ); - classList.remove(...toRemove); + if (toRemove.length) { + classList.remove(...toRemove); + } classList.add(effectiveTheme); }