mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-18 19:56:34 -04:00
Fix node removal hang by adding navigation callback (#2134)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user