mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Fix node removal hang by adding navigation callback (#2134)
This commit is contained in:
parent
a5ade9252a
commit
00295c969e
2 changed files with 7 additions and 0 deletions
|
|
@ -129,6 +129,9 @@ fun NavGraphBuilder.nodeDetailGraph(
|
|||
onNavigate = {
|
||||
navController.navigate(it)
|
||||
},
|
||||
onNavigateUp = {
|
||||
navController.navigateUp()
|
||||
},
|
||||
viewModel = hiltViewModel(parentEntry),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,6 +184,7 @@ fun NodeDetailScreen(
|
|||
uiViewModel: UIViewModel = hiltViewModel(),
|
||||
navigateToMessages: (String) -> Unit,
|
||||
onNavigate: (Route) -> Unit = {},
|
||||
onNavigateUp: () -> Unit = {},
|
||||
) {
|
||||
val state by viewModel.state.collectAsStateWithLifecycle()
|
||||
val environmentState by viewModel.environmentState.collectAsStateWithLifecycle()
|
||||
|
|
@ -229,6 +230,9 @@ fun NodeDetailScreen(
|
|||
val channel =
|
||||
if (hasPKC) DataPacket.PKC_CHANNEL_INDEX else node.channel
|
||||
navigateToMessages("$channel${node.user.id}")
|
||||
} else if (action is NodeMenuAction.Remove) {
|
||||
uiViewModel.handleNodeMenuAction(action)
|
||||
onNavigateUp()
|
||||
} else {
|
||||
uiViewModel.handleNodeMenuAction(action)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue