Maintaining the look of being busy

This commit is contained in:
Kgothatso Ngako
2026-03-26 02:54:36 +02:00
parent 4f9465a204
commit d116e85247
2 changed files with 6 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ fun AuxNavHost(
val navigationViewModel: NavigationViewModel = viewModel (
factory = NavigationViewModel.factory(
NavigationUIState.Landing,
NavigationUIState.Loading,
nostrRepository
)
)

View File

@@ -10,6 +10,7 @@ import androidx.lifecycle.viewModelScope
import co.touchlab.kermit.Logger
import com.vitorpamplona.quartz.nip01Core.core.toHexKey
import com.vitorpamplona.quartz.nip01Core.crypto.KeyPair
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.asStateFlow
@@ -58,8 +59,11 @@ class NavigationViewModel(
private fun observeProfile() {
viewModelScope.launch {
delay(2_100) // Looking busy...
_navigationUIState.getAndUpdate {
NavigationUIState.Landing
}
nostrRepository.observeProfile(tempDevelopmentKeyPair.pubKey.toHexKey()).map { localProfile ->
_navigationUIState.getAndUpdate {
if (localProfile == null) {
NavigationUIState.Landing