fix: Make select from storage work in dashboard

This commit is contained in:
Ax333l
2026-03-20 17:54:39 +01:00
parent c797235861
commit 908db47ee2

View File

@@ -30,12 +30,14 @@ import kotlinx.coroutines.withContext
import java.io.File
import java.nio.file.Files
// TODO: delete this viewmodel and the screen.
@OptIn(SavedStateHandleSaveableApi::class)
class AppSelectorViewModel(
private val app: Application,
private val pm: PM,
fs: Filesystem,
private val patchBundleRepository: PatchBundleRepository,
patchBundleRepository: PatchBundleRepository,
savedStateHandle: SavedStateHandle,
) : ViewModel() {
private val inputFile = savedStateHandle.saveable(key = "inputFile") {
@@ -105,11 +107,7 @@ class AppSelectorViewModel(
return@launch
}
if (patchBundleRepository.isVersionAllowed(selectedApp.packageName, selectedApp.version)) {
storageSelectionChannel.send(selectedApp)
} else {
nonSuggestedVersionDialogSubject = selectedApp
}
storageSelectionChannel.send(selectedApp)
}
private fun loadSelectedFile(uri: Uri) =