mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: add conditional to LaunchedEffect
This commit is contained in:
parent
8d5cca93f1
commit
6f5ed93db3
1 changed files with 2 additions and 2 deletions
|
|
@ -144,9 +144,9 @@ fun RadioConfigNavHost(node: NodeInfo, viewModel: UIViewModel = viewModel()) {
|
|||
val configResponse by viewModel.packetResponse.collectAsStateWithLifecycle()
|
||||
var isWaiting by remember { mutableStateOf(false) }
|
||||
|
||||
LaunchedEffect(configResponse) {
|
||||
if (isWaiting) LaunchedEffect(configResponse) {
|
||||
val data = configResponse?.meshPacket?.decoded
|
||||
if (isWaiting && data?.portnumValue == Portnums.PortNum.ADMIN_APP_VALUE) {
|
||||
if (data?.portnumValue == Portnums.PortNum.ADMIN_APP_VALUE) {
|
||||
val parsed = AdminProtos.AdminMessage.parseFrom(data.payload)
|
||||
when (parsed.payloadVariantCase) {
|
||||
AdminProtos.AdminMessage.PayloadVariantCase.GET_CHANNEL_RESPONSE -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue