Skip to content

Commit

Permalink
fix: jvm signature clash error
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelen123 committed Oct 20, 2023
1 parent 9df98ed commit 4b12ae1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fun SelectedAppInfoScreen(
is SelectedAppInfoDestination.VersionSelector -> VersionSelectorScreen(
onBackClick = navController::pop,
onAppClick = {
vm.setSelectedApp(it)
vm.selectedApp = it
navController.pop()
},
viewModel = getViewModel { parametersOf(vm.selectedApp.packageName) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ class SelectedAppInfoViewModel(input: Params) : ViewModel(), KoinComponent {
private val savedStateHandle: SavedStateHandle = get()
val prefs: PreferencesManager = get()

var selectedApp by savedStateHandle.saveable {
private var _selectedApp by savedStateHandle.saveable {
mutableStateOf(input.app)
}
private set

var selectedApp
get() = _selectedApp
set(value) {
invalidateSelectedAppInfo()
_selectedApp = value
}

var selectedAppInfo: PackageInfo? by mutableStateOf(null)
private set

init {
invalidateSelectedAppInfo()
Expand Down Expand Up @@ -72,11 +77,6 @@ class SelectedAppInfoViewModel(input: Params) : ViewModel(), KoinComponent {
selection
}

fun setSelectedApp(new: SelectedApp) {
selectedApp = new
invalidateSelectedAppInfo()
}

private fun invalidateSelectedAppInfo() = viewModelScope.launch {
val info = when (val app = selectedApp) {
is SelectedApp.Download -> null
Expand Down

0 comments on commit 4b12ae1

Please sign in to comment.