refactor: decouple NavGraph from ViewModel and NodeEntity

This commit is contained in:
andrekir 2024-11-30 07:50:15 -03:00
parent 6678df78b0
commit 716a3f535f
5 changed files with 69 additions and 43 deletions

View file

@ -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,