Refactor: Inject BluetoothViewModel into ConnectionsScreen (#2228)

This commit is contained in:
James Rich 2025-06-22 23:26:04 +00:00 committed by GitHub
parent 1d165a5dc3
commit ca3c787e71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 17 deletions

View file

@ -28,6 +28,7 @@ import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.geeksville.mesh.R
import com.geeksville.mesh.model.BluetoothViewModel
import com.geeksville.mesh.model.UIViewModel
import com.geeksville.mesh.ui.TopLevelDestination.Companion.isTopLevel
import com.geeksville.mesh.ui.debug.DebugScreen
@ -74,6 +75,7 @@ fun NavDestination.showLongNameTitle(): Boolean {
fun NavGraph(
modifier: Modifier = Modifier,
uIViewModel: UIViewModel = hiltViewModel(),
bluetoothViewModel: BluetoothViewModel = hiltViewModel(),
navController: NavHostController = rememberNavController(),
) {
NavHost(
@ -89,7 +91,7 @@ fun NavGraph(
nodesGraph(navController, uIViewModel,)
mapGraph(navController, uIViewModel)
channelsGraph(navController, uIViewModel)
connectionsGraph(navController, uIViewModel)
connectionsGraph(navController, uIViewModel, bluetoothViewModel)
composable<Route.DebugPanel> { DebugScreen() }
radioConfigGraph(navController, uIViewModel)
}