Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v4.0.1 #2362

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/registerServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

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
Expand Down Expand Up @@ -104,6 +104,7 @@
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) => {
Expand All @@ -113,13 +114,13 @@
// No service worker found. Probably a different app. Reload the page.

navigator.serviceWorker.ready
.then((registration) => registration.unregister())

Check warning on line 117 in src/registerServiceWorker.js

View workflow job for this annotation

GitHub Actions / Test release (18.x, ubuntu-latest)

Avoid nesting promises

Check warning on line 117 in src/registerServiceWorker.js

View workflow job for this annotation

GitHub Actions / Build & deploy testing.tor.us (18.x, ubuntu-latest)

Avoid nesting promises

Check warning on line 117 in src/registerServiceWorker.js

View workflow job for this annotation

GitHub Actions / Build & deploy lrc.tor.us (18.x, ubuntu-latest)

Avoid nesting promises
.then(() => {

Check warning on line 118 in src/registerServiceWorker.js

View workflow job for this annotation

GitHub Actions / Test release (18.x, ubuntu-latest)

Avoid nesting promises

Check warning on line 118 in src/registerServiceWorker.js

View workflow job for this annotation

GitHub Actions / Build & deploy testing.tor.us (18.x, ubuntu-latest)

Avoid nesting promises

Check warning on line 118 in src/registerServiceWorker.js

View workflow job for this annotation

GitHub Actions / Build & deploy lrc.tor.us (18.x, ubuntu-latest)

Avoid nesting promises
if (isMain && !window.loginInProgress) {
log.info('can reload now to update app')
}
})
.catch(log.error)

Check warning on line 123 in src/registerServiceWorker.js

View workflow job for this annotation

GitHub Actions / Test release (18.x, ubuntu-latest)

Avoid nesting promises

Check warning on line 123 in src/registerServiceWorker.js

View workflow job for this annotation

GitHub Actions / Build & deploy testing.tor.us (18.x, ubuntu-latest)

Avoid nesting promises

Check warning on line 123 in src/registerServiceWorker.js

View workflow job for this annotation

GitHub Actions / Build & deploy lrc.tor.us (18.x, ubuntu-latest)

Avoid nesting promises
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config)
Expand Down
4 changes: 2 additions & 2 deletions src/store/actions.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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: [
{
Expand Down