manager: refresh superuser applist on appprofile exit

This commit is contained in:
Rifat Azad
2025-01-05 17:06:37 +06:00
parent 56ed1b7a81
commit fcbb02a115
2 changed files with 11 additions and 0 deletions

View File

@@ -56,6 +56,13 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
}
}
LaunchedEffect(Unit) {
if (viewModel.refreshOnReturn) {
viewModel.fetchAppList()
viewModel.refreshOnReturn = false
}
}
Scaffold(
topBar = {
SearchAppBar(
@@ -120,6 +127,7 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
) {
items(viewModel.appList, key = { it.packageName + it.uid }) { app ->
AppItem(app) {
viewModel.refreshOnReturn = true
navigator.navigate(AppProfileScreenDestination(app))
}
}

View File

@@ -31,6 +31,9 @@ import kotlin.coroutines.suspendCoroutine
class SuperUserViewModel : ViewModel() {
var refreshOnReturn by mutableStateOf(false)
public set
companion object {
private const val TAG = "SuperUserViewModel"
private var apps by mutableStateOf<List<AppInfo>>(emptyList())