From 692edfc4ac4fb0b281d254a318632cb23d56f92b Mon Sep 17 00:00:00 2001 From: tomastrajan Date: Thu, 24 May 2018 19:46:00 +0800 Subject: [PATCH] fix(app): only remove existing theme classes --- src/app/app.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }