diff --git a/src/vector/app.js b/src/vector/app.js index cb3ce2a2..65fac653 100644 --- a/src/vector/app.js +++ b/src/vector/app.js @@ -191,8 +191,17 @@ async function autoRegister() { }); const password = "this should be really really secure"; + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + // make sure the server is up (active service worker) await navigator.serviceWorker.ready; + // on Firefix, the ready promise resolves just prior to activation + // on Chrome, the ready promise resolves just after activation. + // We need to make requests AFTER we have been activated, else the /register request + // will fail. + await sleep(10); let response = null; try { diff --git a/src/vector/dendrite.wasm b/src/vector/dendrite.wasm index a1e9b589..38b3618e 100755 Binary files a/src/vector/dendrite.wasm and b/src/vector/dendrite.wasm differ diff --git a/webpack.config.js b/webpack.config.js index 5dbaf20b..999a7ede 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -32,7 +32,7 @@ module.exports = (env, argv) => { entry: { "bundle": "./src/vector/index.js", - // "indexeddb_worker": "./src/vector/indexeddb-worker.js", + "indexeddb_worker": "./src/vector/indexeddb-worker.js", "dendrite_sw": "./src/vector/dendrite-sw.js", "mobileguide": "./src/vector/mobile_guide/index.js", "sqlitejs": "./src/vector/sqlitejs.js",