diff --git a/composeApp/src/commonMain/kotlin/xyz/ksharma/krail/splash/SplashViewModel.kt b/composeApp/src/commonMain/kotlin/xyz/ksharma/krail/splash/SplashViewModel.kt index 05e15d6f..c30e69c6 100644 --- a/composeApp/src/commonMain/kotlin/xyz/ksharma/krail/splash/SplashViewModel.kt +++ b/composeApp/src/commonMain/kotlin/xyz/ksharma/krail/splash/SplashViewModel.kt @@ -3,6 +3,7 @@ package xyz.ksharma.krail.splash import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow @@ -33,9 +34,13 @@ class SplashViewModel( private val _isLoading: MutableStateFlow = MutableStateFlow(false) val isLoading: StateFlow = _isLoading .onStart { - loadKrailThemeStyle() - trackAppStartEvent() - appStart.start() + coroutineScope { + appStart.start() + } + coroutineScope { + loadKrailThemeStyle() + trackAppStartEvent() + } }.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), true) private suspend fun trackAppStartEvent() = with(appInfoProvider.getAppInfo()) { diff --git a/core/app-start/src/commonMain/kotlin/xyz/ksharma/krail/core/appstart/RealAppstart.kt b/core/app-start/src/commonMain/kotlin/xyz/ksharma/krail/core/appstart/RealAppstart.kt index cce6b0e2..f20dfe35 100644 --- a/core/app-start/src/commonMain/kotlin/xyz/ksharma/krail/core/appstart/RealAppstart.kt +++ b/core/app-start/src/commonMain/kotlin/xyz/ksharma/krail/core/appstart/RealAppstart.kt @@ -1,6 +1,7 @@ package xyz.ksharma.krail.core.appstart import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.delay import kotlinx.coroutines.launch import xyz.ksharma.krail.core.log.log import xyz.ksharma.krail.core.remote_config.RemoteConfig