mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
CAKE-28 | created information page, exchange trade view model, exchange trade item; added trade property to trades store; changed filtered method (trade filter store); added tradesStore property to exchange view model; applied information page to exchange trade page
This commit is contained in:
@@ -11,8 +11,7 @@ abstract class TradeFilterStoreBase with Store {
|
||||
TradeFilterStoreBase(
|
||||
{this.displayXMRTO = true,
|
||||
this.displayChangeNow = true,
|
||||
this.displayMorphToken = true,
|
||||
this.wallet});
|
||||
this.displayMorphToken = true});
|
||||
|
||||
@observable
|
||||
bool displayXMRTO;
|
||||
@@ -23,8 +22,6 @@ abstract class TradeFilterStoreBase with Store {
|
||||
@observable
|
||||
bool displayMorphToken;
|
||||
|
||||
WalletBase wallet;
|
||||
|
||||
@action
|
||||
void toggleDisplayExchange(ExchangeProviderDescription provider) {
|
||||
switch (provider) {
|
||||
@@ -40,7 +37,7 @@ abstract class TradeFilterStoreBase with Store {
|
||||
}
|
||||
}
|
||||
|
||||
List<TradeListItem> filtered({List<TradeListItem> trades}) {
|
||||
List<TradeListItem> filtered({List<TradeListItem> trades, WalletBase wallet}) {
|
||||
final _trades =
|
||||
trades.where((item) => item.trade.walletId == wallet.id).toList();
|
||||
final needToFilter = !displayChangeNow || !displayXMRTO || !displayMorphToken;
|
||||
|
||||
@@ -27,6 +27,12 @@ abstract class TradesStoreBase with Store {
|
||||
@observable
|
||||
List<TradeListItem> trades;
|
||||
|
||||
@observable
|
||||
Trade trade;
|
||||
|
||||
@action
|
||||
void setTrade(Trade trade) => this.trade = trade;
|
||||
|
||||
@action
|
||||
Future updateTradeList() async => trades =
|
||||
tradesSource.values.map((trade) => TradeListItem(
|
||||
|
||||
Reference in New Issue
Block a user