Skip to content

Commit

Permalink
fix(wallet-mobile): portfolio sync issues (#3773)
Browse files Browse the repository at this point in the history
Signed-off-by: banklesss <[email protected]>
  • Loading branch information
banklesss authored Dec 23, 2024
1 parent a96e800 commit 57f2a46
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export const DashboardTokensList = () => {
const isPreprod = network === Chain.Network.Preprod

const tokensList = React.useMemo(() => balances.fts ?? [], [balances.fts])

const isJustADA = React.useMemo(() => {
if (tokensList.length >= 2) return false
if (tokensList.length !== 1) return false
const tokenInfo = tokensList[0].info
const isPrimary = isPrimaryToken(tokenInfo)
return isPrimary
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {usePortfolioTokenInfo} from '@yoroi/portfolio'
import {useTheme} from '@yoroi/theme'
import {App} from '@yoroi/types'
import * as React from 'react'
Expand Down Expand Up @@ -28,7 +29,16 @@ export const PortfolioTokenDetailsScreen = () => {
const [isStickyTab, setIsStickyTab] = React.useState(false)
const {id: tokenId} = usePortfolioTokenDetailParams()
const {wallet} = useSelectedWallet()
const tokenInfo = wallet.balances.records.get(tokenId)?.info
const {tokenInfo} = usePortfolioTokenInfo(
{
getTokenInfo: wallet.networkManager.tokenManager.api.tokenInfo,
id: tokenId,
network: wallet.networkManager.network,
primaryTokenInfo: wallet.portfolioPrimaryTokenInfo,
},
{suspense: true},
)

const HEADER_HEIGHT = 304
const {styles} = useStyles(HEADER_HEIGHT)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ export const makeCardanoWallet = (networkManager: Network.Manager, implementatio

async resync() {
await this.clear()
return this.sync()
return this.sync({isForced: true})
}
// end sync

Expand Down

0 comments on commit 57f2a46

Please sign in to comment.