From 3d1d38a2c0cd04d637b878d0a0be7f505f406a97 Mon Sep 17 00:00:00 2001
From: frankiebee <frankie.diamond@gmail.com>
Date: Thu, 8 Jun 2017 17:35:21 -0700
Subject: reload page if ui is not present

---
 mascara/src/ui.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'mascara/src/ui.js')

diff --git a/mascara/src/ui.js b/mascara/src/ui.js
index e798847a7..5f9be542f 100644
--- a/mascara/src/ui.js
+++ b/mascara/src/ui.js
@@ -40,7 +40,6 @@ const connectApp = function (readSw) {
     })
   })
 }
-
 background.on('ready', (sw) => {
   background.removeListener('updatefound', connectApp)
   connectApp(sw)
@@ -48,5 +47,10 @@ background.on('ready', (sw) => {
 background.on('updatefound', () => window.location.reload())
 
 background.startWorker()
-// background.startWorker()
+.then(() => {
+  setTimeout(() => {
+    const appContent = document.getElementById(`app-content`)
+    if (!appContent.children.length) window.location.reload()
+  }, 2000)
+})
 console.log('hello from MetaMascara ui!')
-- 
cgit v1.2.3