Skip to content

Commit

Permalink
fix: create account portfolio flicker
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKheops committed Oct 15, 2024
1 parent dcf7bf5 commit b011a84
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/extension/src/ui/hooks/useSelectAccountAndNavigate.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { sleep } from "@talismn/util"
import { useCallback } from "react"
import { useNavigate } from "react-router-dom"

// TODO remove
export const useSelectAccountAndNavigate = (url: string) => {
const navigate = useNavigate()

const setAddress = useCallback(
(address: string) => {
async (address: string) => {
// this method is used to navigate to the portfolio page with a newly created account
// wait for accounts subscription to be updated on frontend before proceeding or it will flicker
await sleep(250)

const searchParams = new URLSearchParams({
account: address,
})
Expand Down

0 comments on commit b011a84

Please sign in to comment.