diff --git a/package.json b/package.json index 0b68214a0..0096e348f 100644 --- a/package.json +++ b/package.json @@ -53,8 +53,8 @@ "@toruslabs/openlogin-subkey": "^4.7.2", "@toruslabs/openlogin-utils": "^4.7.0", "@uniswap/default-token-list": "^11.5.0", - "@walletconnect/sign-client": "^2.10.0", - "@walletconnect/utils": "^2.10.0", + "@walletconnect/sign-client": "^2.10.1", + "@walletconnect/utils": "^2.10.1", "await-semaphore": "^0.1.3", "bignumber.js": "^9.1.1", "bn.js": "^5.2.1", diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js index 4c95f7baa..5c5ccb90a 100644 --- a/src/registerServiceWorker.js +++ b/src/registerServiceWorker.js @@ -62,7 +62,7 @@ export function register(config) { function registerValidSW(swUrl, config) { navigator.serviceWorker - .register(swUrl, { updateViaCache: 'all', scope: process.env.BASE_URL }) + .register(swUrl, { updateViaCache: 'imports', scope: process.env.BASE_URL }) .then((registration) => { registration.onupdatefound = () => { const installingWorker = registration.installing @@ -104,6 +104,7 @@ function registerValidSW(swUrl, config) { function checkValidServiceWorker(swUrl, config) { // Check if the service worker can be found. If it can't reload the page. fetch(swUrl, { + cache: 'no-cache', headers: { 'Service-Worker': 'script' }, }) .then((response) => { diff --git a/src/store/actions.js b/src/store/actions.js index f5682b0df..7ac42a094 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -1,4 +1,4 @@ -import { isHexString, privateToAddress } from '@ethereumjs/util' +import { isHexString } from '@ethereumjs/util' import { OpenloginSessionManager } from '@toruslabs/openlogin-session-manager' import { BrowserStorage, safeatob, safebtoa } from '@toruslabs/openlogin-utils' import deepmerge from 'deepmerge' @@ -255,7 +255,7 @@ export default { dispatch('subscribeToControllers') commit('setUserInfo', userInfo) - const selectedAddress = `0x${privateToAddress(Buffer.from(privateKey.padStart(64, '0'), 'hex')).toString('hex')}` + const selectedAddress = generateAddressFromPrivateKey(privateKey) await dispatch('initTorusKeyring', { keys: [ {