Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-16 15:40:11 +05:00
parent bc7cb0abe8
commit 90dfc43a90
2 changed files with 7 additions and 2 deletions

View file

@ -123,7 +123,7 @@ internal class MainViewModel @Inject constructor(
private fun fetchStakingTokens() {
viewModelScope.launch(dispatchers.main) {
fetchStakingTokensUseCase()
fetchStakingTokensUseCase(true)
.onLeft { Timber.e(it.toString(), "Unable to fetch the staking tokens list") }
.onRight { Timber.d("Staking token list was fetched successfully") }
}

View file

@ -3,7 +3,9 @@ package com.tangem.datasource.local.logs
import android.content.Context
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
@ -30,7 +32,10 @@ class AppLogsStore @Inject constructor(
dispatchers: CoroutineDispatcherProvider,
) {
private val scope = CoroutineScope(dispatchers.io)
private val scope = CoroutineScope(
context = SupervisorJob() + dispatchers.io +
CoroutineExceptionHandler { _, error -> Timber.e("AppLogsStore.scope is failed $error") },
)
private val mutex = Mutex()
private val file = File(applicationContext.filesDir, LOG_FILE_NAME)