mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
General cleanup and window reload if an update is found
This commit is contained in:
parent
53537824f1
commit
36bafbaebf
@ -10,3 +10,15 @@ npm run mascara
|
||||
- go back to http://localhost:9002
|
||||
- open devTools
|
||||
- click Sync Tx
|
||||
|
||||
## Tests:
|
||||
|
||||
```
|
||||
npm run testMascara
|
||||
```
|
||||
|
||||
Test will run in browser, you will have to have these browsers installed:
|
||||
|
||||
- Chrome
|
||||
- Firefox
|
||||
- Opera
|
||||
|
@ -7,7 +7,7 @@ const connectionListener = new SwGlobalListener(self)
|
||||
const setupMultiplex = require('../../app/scripts/lib/stream-utils.js').setupMultiplex
|
||||
const PortStream = require('../../app/scripts/lib/port-stream.js')
|
||||
|
||||
const DbController = require('./lib/index-db-controller')
|
||||
const DbController = require('idb-global')
|
||||
|
||||
const SwPlatform = require('../../app/scripts/platforms/sw')
|
||||
const MetamaskController = require('../../app/scripts/metamask-controller')
|
||||
@ -47,7 +47,6 @@ console.log('inside:open')
|
||||
let diskStore
|
||||
const dbController = new DbController({
|
||||
key: STORAGE_KEY,
|
||||
version: 2,
|
||||
})
|
||||
loadStateFromPersistence()
|
||||
.then((initState) => setupController(initState))
|
||||
|
@ -20,6 +20,7 @@ background.on('ready', (_) => {
|
||||
pageStream.pipe(swStream).pipe(pageStream)
|
||||
|
||||
})
|
||||
background.on('updatefound', () => window.location.reload())
|
||||
|
||||
background.on('error', console.error)
|
||||
background.startWorker()
|
||||
|
@ -46,15 +46,8 @@ background.on('ready', (sw) => {
|
||||
background.removeListener('updatefound', connectApp)
|
||||
connectApp(sw)
|
||||
})
|
||||
background.on('updatefound', () => background.serviceWorkerApi.ready
|
||||
.then((sw) =>{
|
||||
background.removeListener('ready', connectApp)
|
||||
connectApp(sw.active)
|
||||
})
|
||||
)
|
||||
background.on('message', (messageEvent) => {
|
||||
console.log(messageEvent)
|
||||
})
|
||||
window.addEventListener('load', () => background.startWorker())
|
||||
background.on('updatefound', () => window.location.reload())
|
||||
|
||||
background.startWorker()
|
||||
// background.startWorker()
|
||||
console.log('hello from MetaMascara ui!')
|
||||
|
Loading…
Reference in New Issue
Block a user