diff options
Diffstat (limited to 'mascara')
-rw-r--r-- | mascara/src/background.js | 5 | ||||
-rw-r--r-- | mascara/src/mascara.js | 5 | ||||
-rw-r--r-- | mascara/src/ui.js | 8 |
3 files changed, 8 insertions, 10 deletions
diff --git a/mascara/src/background.js b/mascara/src/background.js index dff5e6a7c..d9dbf593a 100644 --- a/mascara/src/background.js +++ b/mascara/src/background.js @@ -33,11 +33,6 @@ self.addEventListener('install', function(event) { }) self.addEventListener('activate', function(event) { event.waitUntil(self.clients.claim()) - self.clients.matchAll() - .then((clients) => { - if (connectedClientCount < clients.length) sendMessageToAllClients('reconnect') - }) - }) console.log('inside:open') diff --git a/mascara/src/mascara.js b/mascara/src/mascara.js index 0fc2868e1..1655d1f64 100644 --- a/mascara/src/mascara.js +++ b/mascara/src/mascara.js @@ -1,6 +1,6 @@ const Web3 = require('web3') const setupProvider = require('./lib/setup-provider.js') - +const setupDappAutoReload = require('../../app/scripts/lib/auto-reload.js') const MASCARA_ORIGIN = process.env.MASCARA_ORIGIN || 'http://localhost:9001' console.log('MASCARA_ORIGIN:', MASCARA_ORIGIN) @@ -14,8 +14,7 @@ const provider = setupProvider({ instrumentForUserInteractionTriggers(provider) const web3 = new Web3(provider) -global.web3 = web3 - +setupDappAutoReload(web3, provider.publicConfigStore) // // ui stuff // 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!') |