sforkowany z mirror/meshtastic-android
fix: channel config request logic
rodzic
7da958578b
commit
6a72c65a83
|
@ -257,19 +257,19 @@ fun RadioConfigNavHost(node: NodeInfo, viewModel: UIViewModel = viewModel()) {
|
||||||
when (parsed.payloadVariantCase) {
|
when (parsed.payloadVariantCase) {
|
||||||
AdminProtos.AdminMessage.PayloadVariantCase.GET_CHANNEL_RESPONSE -> {
|
AdminProtos.AdminMessage.PayloadVariantCase.GET_CHANNEL_RESPONSE -> {
|
||||||
val response = parsed.getChannelResponse
|
val response = parsed.getChannelResponse
|
||||||
channelList.add(response.index, response.settings)
|
|
||||||
(packetResponseState as PacketResponseState.Loading).completed++
|
(packetResponseState as PacketResponseState.Loading).completed++
|
||||||
if (response.index + 1 < maxChannels) {
|
// Stop once we get to the first disabled entry
|
||||||
// Stop once we get to the first disabled entry
|
if (response.role != ChannelProtos.Channel.Role.DISABLED) {
|
||||||
if (response.role != ChannelProtos.Channel.Role.DISABLED) {
|
channelList.add(response.index, response.settings)
|
||||||
|
if (response.index + 1 < maxChannels) {
|
||||||
// Not done yet, request next channel
|
// Not done yet, request next channel
|
||||||
viewModel.getChannel(destNum, response.index + 1)
|
viewModel.getChannel(destNum, response.index + 1)
|
||||||
} else {
|
} else {
|
||||||
// Received last channel, get lora config (for default channel names)
|
// Received max channels, get lora config (for default channel names)
|
||||||
viewModel.getConfig(destNum, ConfigType.LORA_CONFIG_VALUE)
|
viewModel.getConfig(destNum, ConfigType.LORA_CONFIG_VALUE)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Received max channels, get lora config (for default channel names)
|
// Received last channel, get lora config (for default channel names)
|
||||||
viewModel.getConfig(destNum, ConfigType.LORA_CONFIG_VALUE)
|
viewModel.getConfig(destNum, ConfigType.LORA_CONFIG_VALUE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue