Updated on 2026-08-14
This commit is contained in:
parent
acf110dbcc
commit
6910f74fd9
242 changed files with 866 additions and 732 deletions
|
|
@ -36,12 +36,12 @@ fun SwapCurrencies.getGroupWithDirection(swapDirection: SwapDirection): SwapCurr
|
|||
*
|
||||
* @param available list of available currencies to swap
|
||||
* @param available list of unavailable currencies to swap
|
||||
* @param afterSearch flag indicates whether user searched token
|
||||
* @param isAfterSearch flag indicates whether user searched token
|
||||
*/
|
||||
data class SwapCurrenciesGroup(
|
||||
val available: List<SwapCryptoCurrency>,
|
||||
val unavailable: List<SwapCryptoCurrency>,
|
||||
val afterSearch: Boolean,
|
||||
val isAfterSearch: Boolean,
|
||||
)
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class GetSwapPairsUseCase(
|
|||
return SwapCurrenciesGroup(
|
||||
available = availableCryptoCurrencies,
|
||||
unavailable = unavailableCryptoCurrencies.map { pair -> SwapCryptoCurrency(pair, emptyList()) },
|
||||
afterSearch = false,
|
||||
isAfterSearch = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ class GetSwapSupportedPairsUseCase(
|
|||
emptyList(),
|
||||
)
|
||||
},
|
||||
afterSearch = false,
|
||||
isAfterSearch = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -43,8 +43,8 @@ class SelectInitialPairUseCase(
|
|||
swapCurrenciesGroup: SwapCurrenciesGroup,
|
||||
): CryptoCurrencyStatus? {
|
||||
return secondaryCryptoCurrency?.let {
|
||||
swapCurrenciesGroup.available.firstOrNull {
|
||||
secondaryCryptoCurrency.id == it.currencyStatus.currency.id
|
||||
swapCurrenciesGroup.available.firstOrNull { currency ->
|
||||
secondaryCryptoCurrency.id == currency.currencyStatus.currency.id
|
||||
}?.currencyStatus
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue