File tree Expand file tree Collapse file tree
app/src/main/java/com/cornellappdev/uplift/ui/viewmodels/gyms Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import com.cornellappdev.uplift.util.getSystemTime
1515import dagger.hilt.android.lifecycle.HiltViewModel
1616import kotlinx.coroutines.flow.SharingStarted
1717import kotlinx.coroutines.flow.StateFlow
18+ import kotlinx.coroutines.flow.first
1819import kotlinx.coroutines.flow.map
1920import kotlinx.coroutines.flow.stateIn
2021import kotlinx.coroutines.launch
@@ -104,6 +105,14 @@ class HomeViewModel @Inject constructor(
104105 }
105106
106107 fun navigateToCapacityReminders () {
108+ viewModelScope.launch {
109+ if (! datastoreRepository.hasShownCapacityTutorial().first()) {
110+ datastoreRepository.storePreference(
111+ key = PreferencesKeys .CAPACITY_REMINDERS_TUTORIAL_SHOWN ,
112+ value = true
113+ )
114+ }
115+ }
107116 rootNavigationRepository.navigate(UpliftRootRoute .CapacityReminders )
108117 }
109118
You can’t perform that action at this time.
0 commit comments