Skip to content

Commit

Permalink
feat(rgbpp): use initial data
Browse files Browse the repository at this point in the history
  • Loading branch information
Daryl-L committed Aug 27, 2024
1 parent 9e4df1b commit 3f4d482
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/pages/Address/BTCAddressComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ export const BTCAddressOverviewCard: FC<{ address: Address }> = ({ address }) =>
)
const { boundLiveCellsCount, unboundLiveCellsCount } = data || { boundLiveCellsCount: 0, unboundLiveCellsCount: 0 }

let { data: udtAccounts } = useQuery(['bitcoin address udt accounts', address], async () => {
const data = await explorerService.api.fetchUDTAccountsByBtcAddress(address.bitcoinAddressHash || '')
return data.udtAccounts
})
udtAccounts = udtAccounts || []
const { data: udtAccounts } = useQuery(
['bitcoin address udt accounts', address],
async () => {
const data = await explorerService.api.fetchUDTAccountsByBtcAddress(address.bitcoinAddressHash || '')
return data.udtAccounts
},
{
initialData: [],
},
)

const [udts, inscriptions] = udtAccounts.reduce(
(acc, cur) => {
Expand Down

0 comments on commit 3f4d482

Please sign in to comment.