File tree Expand file tree Collapse file tree
features/tasks/src/main/kotlin/com/edricchan/studybuddy/features/tasks/vm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ import com.edricchan.studybuddy.ui.common.snackbar.SnackBarController
2020import dagger.hilt.android.lifecycle.HiltViewModel
2121import kotlinx.coroutines.flow.MutableStateFlow
2222import kotlinx.coroutines.flow.StateFlow
23- import kotlinx.coroutines.flow.asStateFlow
2423import kotlinx.coroutines.launch
2524import javax.inject.Inject
2625
@@ -75,8 +74,8 @@ class TaskDetailViewModel @Inject constructor(
7574 }
7675 }
7776
78- private val _pendingDelete = MutableStateFlow ( false )
79- val pendingDelete = _pendingDelete .asStateFlow( )
77+ val pendingDelete : StateFlow < Boolean >
78+ field = MutableStateFlow ( false )
8079
8180 suspend fun deleteTask () {
8281 repo.deleteTaskById(currentTaskId)
@@ -90,7 +89,7 @@ class TaskDetailViewModel @Inject constructor(
9089 // setTaskData method would have triggered immediately with an emitted NoData
9190 // state after the task is deleted, which would navigate away before it
9291 // could ever trigger
93- _pendingDelete .value = true
92+ pendingDelete .value = true
9493 deleteTask()
9594 } catch (e: Exception ) {
9695 showSnackBar(
You can’t perform that action at this time.
0 commit comments