Updated on 2026-08-14
This commit is contained in:
parent
299f10a1f6
commit
486f9a6c34
3 changed files with 31 additions and 1 deletions
|
|
@ -89,6 +89,7 @@ import kotlinx.coroutines.flow.*
|
|||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
lateinit var tangemSdkManager: TangemSdkManager
|
||||
lateinit var backupService: BackupService
|
||||
|
|
@ -314,7 +315,11 @@ class MainActivity : AppCompatActivity(), SnackbarHandler, ActivityResultCallbac
|
|||
|
||||
private fun installAppTheme() {
|
||||
appThemeModeFlow = createAppThemeModeFlow()
|
||||
val mode = runBlocking { appThemeModeFlow.first() }
|
||||
val mode = runBlocking {
|
||||
withTimeoutOrNull(APP_THEME_LOAD_TIMEOUT.seconds) {
|
||||
appThemeModeFlow.first()
|
||||
} ?: AppThemeMode.DEFAULT
|
||||
}
|
||||
|
||||
updateAppTheme(mode)
|
||||
}
|
||||
|
|
@ -581,4 +586,8 @@ class MainActivity : AppCompatActivity(), SnackbarHandler, ActivityResultCallbac
|
|||
.onRight { Timber.d("Submitting hashes succeeded") }
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val APP_THEME_LOAD_TIMEOUT = 2
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue