Skip to content

Commit 44788ae

Browse files
committed
LicensesViewModel.kt: Use explicit backing field for selectedLibrary property
1 parent fac7b02 commit 44788ae

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

ui/common/src/main/kotlin/com/edricchan/studybuddy/ui/common/licenses/vm/LicensesViewModel.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import kotlinx.coroutines.FlowPreview
1515
import kotlinx.coroutines.flow.Flow
1616
import kotlinx.coroutines.flow.MutableStateFlow
1717
import kotlinx.coroutines.flow.StateFlow
18-
import kotlinx.coroutines.flow.asStateFlow
1918
import kotlinx.coroutines.flow.combine
2019
import kotlinx.coroutines.flow.debounce
2120
import javax.inject.Inject
@@ -68,11 +67,11 @@ class LicensesViewModel @Inject constructor(
6867
}
6968
}
7069

71-
private val _selectedLibrary = MutableStateFlow<Library?>(null)
72-
val selectedLibrary = _selectedLibrary.asStateFlow()
70+
val selectedLibrary: StateFlow<Library?>
71+
field = MutableStateFlow<Library?>(null)
7372

7473
fun setSelectedLibrary(library: Library?) {
75-
_selectedLibrary.value = library
74+
selectedLibrary.value = library
7675
}
7776

7877
fun clearFilters() {

0 commit comments

Comments
 (0)