You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
manager: refresh superuser applist on appprofile exit
This commit is contained in:
@@ -56,6 +56,13 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
if (viewModel.refreshOnReturn) {
|
||||||
|
viewModel.fetchAppList()
|
||||||
|
viewModel.refreshOnReturn = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
topBar = {
|
topBar = {
|
||||||
SearchAppBar(
|
SearchAppBar(
|
||||||
@@ -120,6 +127,7 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
|
|||||||
) {
|
) {
|
||||||
items(viewModel.appList, key = { it.packageName + it.uid }) { app ->
|
items(viewModel.appList, key = { it.packageName + it.uid }) { app ->
|
||||||
AppItem(app) {
|
AppItem(app) {
|
||||||
|
viewModel.refreshOnReturn = true
|
||||||
navigator.navigate(AppProfileScreenDestination(app))
|
navigator.navigate(AppProfileScreenDestination(app))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ import kotlin.coroutines.suspendCoroutine
|
|||||||
|
|
||||||
class SuperUserViewModel : ViewModel() {
|
class SuperUserViewModel : ViewModel() {
|
||||||
|
|
||||||
|
var refreshOnReturn by mutableStateOf(false)
|
||||||
|
public set
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "SuperUserViewModel"
|
private const val TAG = "SuperUserViewModel"
|
||||||
private var apps by mutableStateOf<List<AppInfo>>(emptyList())
|
private var apps by mutableStateOf<List<AppInfo>>(emptyList())
|
||||||
|
|||||||
Reference in New Issue
Block a user