dont wait to login forever

This commit is contained in:
2026-06-06 14:17:47 +07:00
parent 96f0ca9d9e
commit 3b247190c0

View File

@@ -76,6 +76,11 @@ class NostrViewModel(
private val seenPublicKeys = mutableSetOf<PublicKey>() private val seenPublicKeys = mutableSetOf<PublicKey>()
init { init {
// Skip the splash screen if a user is already logged in
if (nostr.signer.currentUser != null) {
_signerRequired.value = false
}
// Check if the notification banner has been dismissed // Check if the notification banner has been dismissed
checkNotificationBannerDismissedStatus() checkNotificationBannerDismissedStatus()
@@ -216,7 +221,9 @@ class NostrViewModel(
private fun login() { private fun login() {
viewModelScope.launch { viewModelScope.launch {
try { try {
val secret = secretStore.get("user_signer") val secret = withTimeoutOrNull(3.seconds) {
secretStore.get("user_signer")
}
if (secret == null) { if (secret == null) {
_signerRequired.value = true _signerRequired.value = true