Skip to content

Commit

Permalink
Fix for connector issue when opening as safe app (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
nenadV91 authored and W3stside committed Jun 21, 2022
1 parent 8c75261 commit dc6017f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/custom/hooks/web3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export function useEagerConnect() {

if (!walletType || !active) {
localStorage.removeItem(STORAGE_KEY_LAST_PROVIDER)
} else {
} else if (!IS_IN_IFRAME) {
// Set if its not from an Iframe
localStorage.setItem(STORAGE_KEY_LAST_PROVIDER, walletType)
}
}, [connector, active])
Expand Down Expand Up @@ -88,8 +89,8 @@ export function useEagerConnect() {
if (!active) {
const latestProvider = localStorage.getItem(STORAGE_KEY_LAST_PROVIDER)

// If there is no last saved provider set tried state to true
if (!latestProvider) {
// If there is no last saved provider or its running in Iframe, try connecting with safe first
if (!latestProvider || IS_IN_IFRAME) {
if (!triedSafe) {
// First try to connect using Gnosis Safe
connectSafe()
Expand Down

0 comments on commit dc6017f

Please sign in to comment.