From 6ec4b4b9fc8314a0a1c88e51fe664924c4e97fd8 Mon Sep 17 00:00:00 2001
From: Philip Sultanescu <philip@firstorder.io>
Date: Fri, 3 Aug 2018 00:48:04 +0200
Subject: [PATCH] fix(theme-picker) fix theme picker bugs on mobile

Closes #495
---
 src/app/shared/theme-picker/theme-picker.ts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/app/shared/theme-picker/theme-picker.ts b/src/app/shared/theme-picker/theme-picker.ts
index 8bd5bae72..f65cca23d 100644
--- a/src/app/shared/theme-picker/theme-picker.ts
+++ b/src/app/shared/theme-picker/theme-picker.ts
@@ -63,7 +63,10 @@ export class ThemePicker {
     if (theme.isDefault) {
       this.styleManager.removeStyle('theme');
     } else {
-      this.styleManager.setStyle('theme', `assets/${theme.href}`);
+      // use timout to fix https://github.com/angular/material.angular.io/issues/495
+      setTimeout(() => {
+        this.styleManager.setStyle('theme', `assets/${theme.href}`);
+      });
     }
 
     if (this.currentTheme) {