add more info on current dvm state

This commit is contained in:
Believethehype
2024-05-16 15:19:19 +02:00
parent 4fb9c93cf0
commit 193e9a5adb
2 changed files with 6 additions and 3 deletions

View File

@@ -102,7 +102,8 @@ fun RenderNostrNIP90ContentDiscoveryScreen(
val coroutineScope = rememberCoroutineScope()
// TODO this now shows the first status update but there might be a better way
var dvmStatus = stringResource(R.string.dvm_no_status)
var dvmState = stringResource(R.string.dvm_waiting_status)
var dvmNoState = stringResource(R.string.dvm_no_status)
val thread =
Thread {
@@ -111,9 +112,10 @@ fun RenderNostrNIP90ContentDiscoveryScreen(
try {
if (statusFeedViewModel.localFilter.feed().isNotEmpty()) {
statusFeedViewModel.localFilter.feed()[0].event?.let { dvmStatus = it.content() }
println(dvmStatus)
println(dvmState)
break
} else if (count > 1000) {
dvmState = dvmNoState
// Might not be the best way, but we want to avoid hanging in the loop forever
} else {
count++
@@ -142,7 +144,7 @@ fun RenderNostrNIP90ContentDiscoveryScreen(
null,
onEmpty = {
// TODO Maybe also show some dvm image/text while waiting for the notes in this custom component
FeedEmptywithStatus(status = dvmStatus) {
FeedEmptywithStatus(status = dvmState) {
}
},
)

View File

@@ -847,5 +847,6 @@
<string name="load_from_text">From Msg</string>
<string name="dvm_waiting_status">Waiting for DVM to reply</string>
<string name="dvm_no_status">DVM seems not to reply</string>
</resources>