Skip to content

Commit

Permalink
🪄 [QA] Update stage environments (#888)
Browse files Browse the repository at this point in the history
This is a pull request that upon merging will update stage environments
with recent `main` changes.
The environments that will be updated:
* Stage live: https://stage-live--taho-development.netlify.app/
* Stage fork: https://stage-fork--taho-development.netlify.app/

Read more: [Deployment to Production
Flow](https://github.com/tahowallet/dapp/blob/main/docs/testing-env.md)
  • Loading branch information
michalinacienciala authored Dec 14, 2023
2 parents 1c7b53c + ae479e9 commit d2e07d8
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/shared/hooks/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,21 +285,26 @@ export function useCachedWalletName() {

useEffect(() => {
const handleCachedNamesUpdate = () => {
if (!address) return

const cachedNames = localStorage.getItem(LOCAL_STORAGE_CACHED_NAMES)
if (!cachedNames) return

const parsedCachedNames: CachedNames = JSON.parse(cachedNames)
const { ens, uns } = parsedCachedNames[address]

if (ens || uns) {
// If cached name and redux wallet name are the same do not dispatch wallet update action
if (walletName === ens?.name || walletName === uns?.name) return

dispatch(
updateConnectedWallet({ address, name: ens?.name ?? uns?.name })
)
try {
if (!address) return

const cachedNames = localStorage.getItem(LOCAL_STORAGE_CACHED_NAMES)
if (!cachedNames) return

const parsedCachedNames: CachedNames = JSON.parse(cachedNames)
const { ens, uns } = parsedCachedNames[address] ?? {}

if (ens || uns) {
// If cached name and redux wallet name are the same do not dispatch wallet update action
if (walletName === ens?.name || walletName === uns?.name) return

dispatch(
updateConnectedWallet({ address, name: ens?.name ?? uns?.name })
)
}
} catch (err) {
// eslint-disable-next-line no-console
console.error(err)
}
}

Expand Down

0 comments on commit d2e07d8

Please sign in to comment.