fix syncing state
This commit is contained in:
@@ -219,6 +219,7 @@ class Nostr {
|
||||
KindStandard.INBOX_RELAYS -> {
|
||||
// Get all gift wrap events for the current user
|
||||
if (isSignedByUser(event = event)) {
|
||||
messages.updateSyncState { it.copy(isSyncing = true) }
|
||||
messages.getUserMessages(msgRelayList = event)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class ChatViewModel(private val nostr: Nostr) : BaseViewModel() {
|
||||
launch {
|
||||
nostr.messages.messageSyncState.collect { syncState ->
|
||||
// When at least some messages are processed, allow UI to show the list
|
||||
if (syncState.processedCount > 0) {
|
||||
if (syncState.processedCount > 0 || !syncState.isSyncing) {
|
||||
_state.update { it.copy(isPartialProcessedGiftWrap = true) }
|
||||
}
|
||||
|
||||
|
||||
@@ -72,8 +72,6 @@ class NostrViewModel(private val nostr: Nostr) : BaseViewModel() {
|
||||
private val metadataRequestChannel = Channel<PublicKey>(Channel.UNLIMITED)
|
||||
private val seenPublicKeys = mutableSetOf<PublicKey>()
|
||||
|
||||
val isBusy = appState.map { it.isBusy }
|
||||
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), false)
|
||||
val isRelayListEmpty = appState.map { it.isRelayListEmpty }
|
||||
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user