mirror of
https://github.com/mollyim/monero-wallet-sdk.git
synced 2025-02-04 17:05:35 -05:00
demo: clear selected remote nodes on network toggle
This commit is contained in:
parent
743e9997c5
commit
ec41094ae9
@ -49,20 +49,9 @@ class AddWalletViewModel(
|
||||
private fun getSelectedRemoteNodeIds() =
|
||||
selectedRemoteNodes.filterValues { checked -> checked }.keys.filterNotNull()
|
||||
|
||||
init {
|
||||
val previousNodes = mutableSetOf<RemoteNode>()
|
||||
|
||||
currentRemoteNodes.onEach { remoteNodes ->
|
||||
val unseenNodes = remoteNodes.filter { it !in previousNodes }
|
||||
unseenNodes.forEach { node ->
|
||||
selectedRemoteNodes[node.id] = true
|
||||
previousNodes.add(node)
|
||||
}
|
||||
}.launchIn(viewModelScope)
|
||||
}
|
||||
|
||||
fun toggleSelectedNetwork(network: MoneroNetwork) {
|
||||
viewModelState.update { it.copy(network = network) }
|
||||
selectedRemoteNodes.clear()
|
||||
}
|
||||
|
||||
fun updateWalletName(name: String) {
|
||||
|
@ -317,7 +317,7 @@ private fun SecondStepScreen(
|
||||
AlertDialog(onDismissRequest = { showOffLineConfirmationDialog = false }, title = {
|
||||
Text("No remote nodes selected")
|
||||
}, text = {
|
||||
Text("There are no remote nodes added to your wallet settings. Are you sure you want to create an offline wallet?")
|
||||
Text("It seems there are no remote nodes added to your wallet settings. Are you sure you want to create an offline wallet?")
|
||||
}, confirmButton = {
|
||||
TextButton(onClick = {
|
||||
showOffLineConfirmationDialog = false
|
||||
|
@ -149,7 +149,10 @@ class RemoteNodeClient private constructor(
|
||||
|
||||
delay(retryBackoff.waitTime(retryCount))
|
||||
|
||||
logger.d("HTTP: $method $uri")
|
||||
|
||||
val response = try {
|
||||
|
||||
val request = requestBuilder.url(uri.toString()).build()
|
||||
|
||||
httpClient.newCall(request).await()
|
||||
|
Loading…
x
Reference in New Issue
Block a user