mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: decouple NavGraph from ViewModel and NodeEntity
This commit is contained in:
parent
6678df78b0
commit
716a3f535f
5 changed files with 69 additions and 43 deletions
|
|
@ -98,14 +98,14 @@ import kotlin.math.ln
|
|||
|
||||
@Composable
|
||||
fun NodeDetailScreen(
|
||||
node: NodeEntity?,
|
||||
viewModel: MetricsViewModel = hiltViewModel(),
|
||||
modifier: Modifier = Modifier,
|
||||
onNavigate: (Any) -> Unit,
|
||||
) {
|
||||
val state by viewModel.state.collectAsStateWithLifecycle()
|
||||
|
||||
if (node != null) {
|
||||
if (state.node != null) {
|
||||
val node = state.node ?: return
|
||||
NodeDetailList(
|
||||
node = node,
|
||||
metricsState = state,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue