fix: jvm signature clash error

This commit is contained in:
Ax333l 2023-10-20 17:21:59 +02:00
parent 9df98edca5
commit 4b12ae1531
2 changed files with 9 additions and 9 deletions

View File

@ -107,7 +107,7 @@ fun SelectedAppInfoScreen(
is SelectedAppInfoDestination.VersionSelector -> VersionSelectorScreen( is SelectedAppInfoDestination.VersionSelector -> VersionSelectorScreen(
onBackClick = navController::pop, onBackClick = navController::pop,
onAppClick = { onAppClick = {
vm.setSelectedApp(it) vm.selectedApp = it
navController.pop() navController.pop()
}, },
viewModel = getViewModel { parametersOf(vm.selectedApp.packageName) } viewModel = getViewModel { parametersOf(vm.selectedApp.packageName) }

View File

@ -35,13 +35,18 @@ class SelectedAppInfoViewModel(input: Params) : ViewModel(), KoinComponent {
private val savedStateHandle: SavedStateHandle = get() private val savedStateHandle: SavedStateHandle = get()
val prefs: PreferencesManager = get() val prefs: PreferencesManager = get()
var selectedApp by savedStateHandle.saveable { private var _selectedApp by savedStateHandle.saveable {
mutableStateOf(input.app) mutableStateOf(input.app)
} }
private set
var selectedApp
get() = _selectedApp
set(value) {
invalidateSelectedAppInfo()
_selectedApp = value
}
var selectedAppInfo: PackageInfo? by mutableStateOf(null) var selectedAppInfo: PackageInfo? by mutableStateOf(null)
private set
init { init {
invalidateSelectedAppInfo() invalidateSelectedAppInfo()
@ -72,11 +77,6 @@ class SelectedAppInfoViewModel(input: Params) : ViewModel(), KoinComponent {
selection selection
} }
fun setSelectedApp(new: SelectedApp) {
selectedApp = new
invalidateSelectedAppInfo()
}
private fun invalidateSelectedAppInfo() = viewModelScope.launch { private fun invalidateSelectedAppInfo() = viewModelScope.launch {
val info = when (val app = selectedApp) { val info = when (val app = selectedApp) {
is SelectedApp.Download -> null is SelectedApp.Download -> null