Skip to content

Commit

Permalink
fix extra id ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhii-Borodenko committed Dec 12, 2024
1 parent 204e0b8 commit 797be44
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions lib/view_model/exchange/exchange_trade_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ abstract class ExchangeTradeViewModelBase with Store {

void _updateItems() {
final tagFrom =
tradesStore.trade!.from.tag != null ? '${tradesStore.trade!.from.tag}' + ' ' : '';
tradesStore.trade!.from.tag != null ? '${tradesStore.trade!.from.tag}' + ' ' : '';
final tagTo = tradesStore.trade!.to.tag != null ? '${tradesStore.trade!.to.tag}' + ' ' : '';
items.clear();

Expand All @@ -159,24 +159,14 @@ abstract class ExchangeTradeViewModelBase with Store {
),
);

if (trade.extraId != null) {
final title = trade.from == CryptoCurrency.xrp
? S.current.destination_tag
: trade.from == CryptoCurrency.xlm
? S.current.memo
: S.current.extra_id;

items.add(ExchangeTradeItem(title: title, data: '${trade.extraId}', isCopied: true));
}

items.addAll([
ExchangeTradeItem(
title: S.current.amount,
data: '${trade.amount} ${trade.from}',
isCopied: true,
),
ExchangeTradeItem(
title: S.current.estimated_receive_amount +':',
title: S.current.estimated_receive_amount + ':',
data: '${tradesStore.trade?.receiveAmount} ${trade.to}',
isCopied: true,
),
Expand All @@ -185,12 +175,25 @@ abstract class ExchangeTradeViewModelBase with Store {
data: trade.inputAddress ?? '',
isCopied: true,
),
]);

if (trade.extraId != null) {
final title = trade.from == CryptoCurrency.xrp
? S.current.destination_tag
: trade.from == CryptoCurrency.xlm
? S.current.memo
: S.current.extra_id;

items.add(ExchangeTradeItem(title: title, data: '${trade.extraId}', isCopied: true));
}

items.add(
ExchangeTradeItem(
title: S.current.arrive_in_this_address('${tradesStore.trade!.to}', tagTo) + ':',
data: trade.payoutAddress ?? '',
isCopied: true,
),
]);
);
}

static bool _checkIfCanSend(TradesStore tradesStore, WalletBase wallet) {
Expand Down

0 comments on commit 797be44

Please sign in to comment.