Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wallet-mobile): portfolio sync issues #3773

Merged
merged 4 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to fix "balance 0" issue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be there from day one, nice catch!

}
// end sync

Expand Down
Loading