Update AppNavGraph.kt
This commit is contained in:
parent
46ef4521cc
commit
af9a5487b1
@ -86,8 +86,14 @@ fun AppNavGraph(
|
|||||||
val transProcessViewModel: TransProcessViewModel = hiltViewModel(activity)
|
val transProcessViewModel: TransProcessViewModel = hiltViewModel(activity)
|
||||||
val dashboardViewModel: DashboardViewModel = hiltViewModel(activity)
|
val dashboardViewModel: DashboardViewModel = hiltViewModel(activity)
|
||||||
val dashboardUiState = dashboardViewModel.uiState.collectAsStateWithLifecycle().value
|
val dashboardUiState = dashboardViewModel.uiState.collectAsStateWithLifecycle().value
|
||||||
|
val deviceInfoViewModel: DeviceInfoViewModel = hiltViewModel(activity)
|
||||||
|
val deviceInfoUiState = deviceInfoViewModel.uiState.collectAsStateWithLifecycle().value
|
||||||
val tmsSetupViewModel: TmsSetupViewModel = hiltViewModel();
|
val tmsSetupViewModel: TmsSetupViewModel = hiltViewModel();
|
||||||
|
|
||||||
|
LaunchedEffect(deviceInfoViewModel) {
|
||||||
|
deviceInfoViewModel.loadDeviceInfo()
|
||||||
|
}
|
||||||
|
|
||||||
LaunchedEffect(tmsSetupViewModel) {
|
LaunchedEffect(tmsSetupViewModel) {
|
||||||
tmsSetupViewModel.onSyncCompleted.collect {
|
tmsSetupViewModel.onSyncCompleted.collect {
|
||||||
dashboardViewModel.refreshLastSyncTime()
|
dashboardViewModel.refreshLastSyncTime()
|
||||||
@ -97,6 +103,7 @@ fun AppNavGraph(
|
|||||||
transProcessViewModel.resetTransactionStatus()
|
transProcessViewModel.resetTransactionStatus()
|
||||||
DashboardScreen2(
|
DashboardScreen2(
|
||||||
dashboardUiState = dashboardUiState,
|
dashboardUiState = dashboardUiState,
|
||||||
|
deviceInfo = deviceInfoUiState,
|
||||||
onClickLastSync = {
|
onClickLastSync = {
|
||||||
tmsSetupViewModel.downloadConfigs()
|
tmsSetupViewModel.downloadConfigs()
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user