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

IOS-8131 Recalculate fiat #3976

Merged
merged 2 commits into from
Sep 30, 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 @@ -40,7 +40,6 @@ extension CommonExpressModulesFactory: ExpressModulesFactory {
initialWallet: initialWalletModel,
userWalletModel: userWalletModel,
feeFormatter: feeFormatter,
balanceConverter: balanceConverter,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

не юзалось

balanceFormatter: balanceFormatter,
expressProviderFormatter: expressProviderFormatter,
notificationManager: notificationManager,
Expand Down
9 changes: 5 additions & 4 deletions Tangem/Modules/ExpressView/ExpressViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ final class ExpressViewModel: ObservableObject {
private let initialWallet: WalletModel
private let userWalletModel: UserWalletModel
private let feeFormatter: FeeFormatter
private let balanceConverter: BalanceConverter
private let balanceFormatter: BalanceFormatter
private let expressProviderFormatter: ExpressProviderFormatter
private let notificationManager: NotificationManager
Expand All @@ -62,7 +61,6 @@ final class ExpressViewModel: ObservableObject {
initialWallet: WalletModel,
userWalletModel: UserWalletModel,
feeFormatter: FeeFormatter,
balanceConverter: BalanceConverter,
balanceFormatter: BalanceFormatter,
expressProviderFormatter: ExpressProviderFormatter,
notificationManager: NotificationManager,
Expand All @@ -73,7 +71,6 @@ final class ExpressViewModel: ObservableObject {
self.initialWallet = initialWallet
self.userWalletModel = userWalletModel
self.feeFormatter = feeFormatter
self.balanceConverter = balanceConverter
self.balanceFormatter = balanceFormatter
self.expressProviderFormatter = expressProviderFormatter
self.notificationManager = notificationManager
Expand Down Expand Up @@ -336,7 +333,11 @@ private extension ExpressViewModel {
let roundedAmount = amount.rounded(scale: wallet.decimalCount, roundingMode: .down)

// Exclude unnecessary update
guard roundedAmount != amount else { return }
guard roundedAmount != amount else {
// update only fiat in case of another walletModel selection with another quote
updateSendFiatValue(amount: amount)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

вот тут не хватало апдейта

Copy link
Contributor

Choose a reason for hiding this comment

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

Не знаком с этим кодом совсем, но это не приведет к лишним апдейтам, которые потом триггернут поход в сеть, etc?

return
}

updateSendDecimalValue(to: roundedAmount)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class ExpressModulesFactoryMock: ExpressModulesFactory {
initialWallet: initialWalletModel,
userWalletModel: userWalletModel,
feeFormatter: feeFormatter,
balanceConverter: balanceConverter,
balanceFormatter: balanceFormatter,
expressProviderFormatter: expressProviderFormatter,
notificationManager: notificationManager,
Expand Down
Loading