Skip to content

Commit

Permalink
fix(app): only remove existing theme classes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomastrajan committed May 24, 2018
1 parent 718be96 commit 692edfc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 692edfc

Please sign in to comment.