diff --git a/presentation/src/main/java/xyz/aprildown/timer/presentation/timer/RecordViewModel.kt b/presentation/src/main/java/xyz/aprildown/timer/presentation/timer/RecordViewModel.kt index 1f2779ef..cd58d411 100644 --- a/presentation/src/main/java/xyz/aprildown/timer/presentation/timer/RecordViewModel.kt +++ b/presentation/src/main/java/xyz/aprildown/timer/presentation/timer/RecordViewModel.kt @@ -62,12 +62,13 @@ class RecordViewModel @Inject constructor( getRecords.calculateTimeline(it) } - private val _minDateMilli = MutableLiveData() + private val _minDateMilli: MutableLiveData = MutableLiveData() val minDateMilli: LiveData = _minDateMilli init { launch { - _minDateMilli.value = getRecords.getMinDateMilli() + val minDateMilli: Long = getRecords.getMinDateMilli() + _minDateMilli.value = minDateMilli val all = mutableListOf() val sortBy = folderSortByRule.get() diff --git a/presentation/src/main/java/xyz/aprildown/timer/presentation/timer/TimerViewModel.kt b/presentation/src/main/java/xyz/aprildown/timer/presentation/timer/TimerViewModel.kt index b45c5cf4..080b5c87 100644 --- a/presentation/src/main/java/xyz/aprildown/timer/presentation/timer/TimerViewModel.kt +++ b/presentation/src/main/java/xyz/aprildown/timer/presentation/timer/TimerViewModel.kt @@ -79,7 +79,7 @@ class TimerViewModel @Inject constructor( folders.find { it.id == id } }.asLiveData() - private val currentSortBy = MutableLiveData() + private val currentSortBy: MutableLiveData = MutableLiveData() val timerInfo: LiveData> = currentFolderId.asFlow().combine(currentSortBy.asFlow()) { id, by -> @@ -106,12 +106,14 @@ class TimerViewModel @Inject constructor( } else { FolderEntity.FOLDER_DEFAULT } - currentSortBy.value = folderSortByRule.get() + val folderSortBy: FolderSortBy = folderSortByRule.get() + currentSortBy.value = folderSortBy } } private suspend fun refreshFolders() { - _allFolders.value = getFolders.invoke() + val folders: List = getFolders() + _allFolders.value = folders } fun changeFolder(folderId: Long) {