Updated on 2026-08-14
This commit is contained in:
parent
acf110dbcc
commit
6910f74fd9
242 changed files with 866 additions and 732 deletions
|
|
@ -122,10 +122,10 @@ internal class DefaultWalletAccountsFetcher @Inject constructor(
|
|||
|
||||
responseBody
|
||||
},
|
||||
onError = {
|
||||
onError = { throwable ->
|
||||
// pushWalletAccounts and storeWalletAccounts help to avoid cyclic dependency
|
||||
fetchWalletAccountsErrorHandler.handle(
|
||||
error = it,
|
||||
error = throwable,
|
||||
userWalletId = userWalletId,
|
||||
savedAccountsResponse = savedAccountsResponse,
|
||||
pushWalletAccounts = ::push,
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ internal class WalletAccountListFlowFactory @Inject constructor(
|
|||
val currencies = if (isSingleWalletWithToken) {
|
||||
cardCryptoCurrencyFactory.createCurrenciesForSingleCurrencyCardWithToken(userWallet = userWallet).toSet()
|
||||
} else {
|
||||
cardCryptoCurrencyFactory.createPrimaryCurrencyForSingleCurrencyCard(userWallet = userWallet).let(::setOf)
|
||||
setOf(cardCryptoCurrencyFactory.createPrimaryCurrencyForSingleCurrencyCard(userWallet = userWallet))
|
||||
}
|
||||
|
||||
return AccountList.empty(userWallet = userWallet, cryptoCurrencies = currencies)
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ class DefaultDeviceFlipDetector @Inject constructor(
|
|||
) : DeviceFlipDetector, DefaultLifecycleObserver {
|
||||
|
||||
private val sensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager
|
||||
private var gravitySensor = sensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY)
|
||||
private var isResumedState = AtomicBoolean(false)
|
||||
private val gravitySensor = sensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY)
|
||||
private val isResumedState = AtomicBoolean(false)
|
||||
|
||||
override fun onPause(owner: LifecycleOwner) {
|
||||
isResumedState.set(false)
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ internal class FlipListener(private val action: () -> Unit) : SensorEventListene
|
|||
}
|
||||
|
||||
override fun onSensorChanged(event: SensorEvent?) {
|
||||
event?.let {
|
||||
if (event != null) {
|
||||
val currentTime = SystemClock.elapsedRealtime()
|
||||
val zAxisValue = it.values[2]
|
||||
val zAxisValue = event.values[2]
|
||||
|
||||
if (zAxisValue < zAxisThreshold && !isScreenDown) {
|
||||
isScreenDown = true
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ suspend inline fun <T> safeApiCallWithTimeout(
|
|||
): T = safeApiCall(
|
||||
call = {
|
||||
withTimeoutOrNull(timeoutMillis) { call() }
|
||||
?: raise(ApiResponseError.TimeoutException)
|
||||
?: raise(ApiResponseError.TimeoutException())
|
||||
},
|
||||
onError = onError,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -30,13 +30,22 @@ internal class DefaultAppRatingRepository(
|
|||
override fun isReadyToShow(): Flow<Boolean> {
|
||||
// TODO: [REDACTED_JIRA]
|
||||
return combine(
|
||||
appPreferencesStore.get(key = PreferencesKeys.USER_WAS_INTERACT_WITH_RATING_KEY, default = false),
|
||||
appPreferencesStore.get(
|
||||
flow = appPreferencesStore.get(
|
||||
key = PreferencesKeys.USER_WAS_INTERACT_WITH_RATING_KEY,
|
||||
default = false,
|
||||
),
|
||||
flow2 = appPreferencesStore.get(
|
||||
key = PreferencesKeys.SHOW_RATING_DIALOG_AT_LAUNCH_COUNT_KEY,
|
||||
default = FIRST_SHOWING_COUNT,
|
||||
),
|
||||
appPreferencesStore.get(key = PreferencesKeys.APP_LAUNCH_COUNT_KEY, default = DEFAULT_APP_LAUNCH_COUNT),
|
||||
appPreferencesStore.get(key = PreferencesKeys.FUNDS_FOUND_DATE_KEY, default = FUNDS_FOUND_DATE_UNDEFINED),
|
||||
flow3 = appPreferencesStore.get(
|
||||
key = PreferencesKeys.APP_LAUNCH_COUNT_KEY,
|
||||
default = DEFAULT_APP_LAUNCH_COUNT,
|
||||
),
|
||||
flow4 = appPreferencesStore.get(
|
||||
key = PreferencesKeys.FUNDS_FOUND_DATE_KEY,
|
||||
default = FUNDS_FOUND_DATE_UNDEFINED,
|
||||
),
|
||||
) { isInteracting, ratingShowingCount, appLaunchCount, fundsFoundDate ->
|
||||
if (!isInteracting) {
|
||||
val diff = Calendar.getInstance().timeInMillis - fundsFoundDate
|
||||
|
|
|
|||
|
|
@ -101,12 +101,12 @@ class DefaultTxHistoryRepository(
|
|||
userWalletId: UserWalletId,
|
||||
currency: CryptoCurrency,
|
||||
pageSize: Int,
|
||||
refresh: Boolean,
|
||||
shouldRefresh: Boolean,
|
||||
): List<TxInfo> = withContext(dispatchers.io) {
|
||||
try {
|
||||
cacheRegistry.invokeOnExpire(
|
||||
key = getTxHistoryPageKey(currency, userWalletId, Page.Initial),
|
||||
skipCache = refresh,
|
||||
skipCache = shouldRefresh,
|
||||
block = { fetchFixedSizeTxHistoryItems(userWalletId, currency, pageSize) },
|
||||
)
|
||||
val txs = txHistoryItemsStore.getSyncOrNull(
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ internal class RefactoredTxHistoryRepository(
|
|||
): PaginationWrapper<TxInfo> {
|
||||
cacheRegistry.invokeOnExpire(
|
||||
key = getTxHistoryPageKey(request.page, request.params),
|
||||
skipCache = request.params.refresh,
|
||||
skipCache = request.params.shouldRefresh,
|
||||
block = { fetch(request, batchSize) },
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ internal class DefaultVisaRepository @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
override suspend fun getTxHistory(
|
||||
override fun getTxHistory(
|
||||
userWalletId: UserWalletId,
|
||||
pageSize: Int,
|
||||
isRefresh: Boolean,
|
||||
|
|
@ -218,7 +218,7 @@ internal class DefaultVisaRepository @Inject constructor(
|
|||
return cardWallet.publicKey.toHexString()
|
||||
}
|
||||
|
||||
private suspend fun findVisaUserWallet(userWalletId: UserWalletId): UserWallet {
|
||||
private fun findVisaUserWallet(userWalletId: UserWalletId): UserWallet {
|
||||
val userWallet = requireNotNull(userWalletsStore.getSyncOrNull(userWalletId)) {
|
||||
"No user wallet found: $userWalletId"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ internal class MockVisaRepository @Inject constructor() : VisaRepository {
|
|||
TODO("Not implemented for this build type")
|
||||
}
|
||||
|
||||
override suspend fun getTxHistory(
|
||||
override fun getTxHistory(
|
||||
userWalletId: UserWalletId,
|
||||
pageSize: Int,
|
||||
isRefresh: Boolean,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue