mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +00:00
desktop send form token price fix
This commit is contained in:
parent
6eb9651fbb
commit
cefbc42715
1 changed files with 12 additions and 4 deletions
|
@ -370,8 +370,12 @@ class _DesktopTokenSendState extends ConsumerState<DesktopTokenSend> {
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
_cachedAmountToSend = _amountToSend;
|
_cachedAmountToSend = _amountToSend;
|
||||||
|
|
||||||
final price =
|
final price = ref
|
||||||
ref.read(priceAnd24hChangeNotifierProvider).getPrice(coin).item1;
|
.read(priceAnd24hChangeNotifierProvider)
|
||||||
|
.getTokenPrice(
|
||||||
|
ref.read(tokenServiceProvider)!.tokenContract.address,
|
||||||
|
)
|
||||||
|
.item1;
|
||||||
|
|
||||||
if (price > Decimal.zero) {
|
if (price > Decimal.zero) {
|
||||||
final String fiatAmountString = Amount.fromDecimal(
|
final String fiatAmountString = Amount.fromDecimal(
|
||||||
|
@ -512,8 +516,12 @@ class _DesktopTokenSendState extends ConsumerState<DesktopTokenSend> {
|
||||||
.toAmount(fractionDigits: 2)
|
.toAmount(fractionDigits: 2)
|
||||||
: Decimal.parse(baseAmountString).toAmount(fractionDigits: 2);
|
: Decimal.parse(baseAmountString).toAmount(fractionDigits: 2);
|
||||||
|
|
||||||
final Decimal _price =
|
final Decimal _price = ref
|
||||||
ref.read(priceAnd24hChangeNotifierProvider).getPrice(coin).item1;
|
.read(priceAnd24hChangeNotifierProvider)
|
||||||
|
.getTokenPrice(
|
||||||
|
ref.read(tokenServiceProvider)!.tokenContract.address,
|
||||||
|
)
|
||||||
|
.item1;
|
||||||
|
|
||||||
if (_price == Decimal.zero) {
|
if (_price == Decimal.zero) {
|
||||||
_amountToSend = Decimal.zero.toAmount(fractionDigits: tokenDecimals);
|
_amountToSend = Decimal.zero.toAmount(fractionDigits: tokenDecimals);
|
||||||
|
|
Loading…
Reference in a new issue