You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: wear/src/main/java/com/example/util/simpletimetracker/presentation/screens/activities/ActivitiesViewModel.kt
+7-7
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,6 @@ class ActivitiesViewModel @Inject constructor(
43
43
44
44
funinit() {
45
45
if (isInitialized) return
46
-
loadData()
47
46
subscribeToDataUpdates()
48
47
isInitialized =true
49
48
}
@@ -63,17 +62,18 @@ class ActivitiesViewModel @Inject constructor(
63
62
if (result.isFailure) showError()
64
63
}
65
64
66
-
funonRefresh() {
67
-
loadData()
65
+
funonRefresh() = viewModelScope.launch {
66
+
loadData(forceReload =true)
67
+
wearDataRepo.updateComplications()
68
68
}
69
69
70
70
funonOpenOnPhone() = viewModelScope.launch {
71
71
wearDataRepo.openAppPhone()
72
72
}
73
73
74
-
privatefunloadData() = viewModelScope.launch {
75
-
val activities = wearDataRepo.loadActivities()
76
-
val currentActivities = wearDataRepo.loadCurrentActivities()
74
+
privatesuspendfunloadData(forceReload:Boolean) {
75
+
val activities = wearDataRepo.loadActivities(forceReload)
76
+
val currentActivities = wearDataRepo.loadCurrentActivities(forceReload)
0 commit comments