manager: module: refresh after webui usage (#2317)
- This commit fixes issue tiann#2250 https://github.com/user-attachments/assets/19dcca12-cb34-4e6e-88b4-72c26c2773f3 Tested by: backslashxx <118538522+backslashxx@users.noreply.github.com>
This commit is contained in:
@@ -133,6 +133,10 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
||||
|
||||
val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState())
|
||||
|
||||
val webUILauncher = rememberLauncherForActivityResult(
|
||||
contract = ActivityResultContracts.StartActivityForResult()
|
||||
) { viewModel.fetchModuleList() }
|
||||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
TopAppBar(
|
||||
@@ -253,7 +257,7 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
||||
},
|
||||
onClickModule = { id, name, hasWebUi ->
|
||||
if (hasWebUi) {
|
||||
context.startActivity(
|
||||
webUILauncher.launch(
|
||||
Intent(context, WebUIActivity::class.java)
|
||||
.setData(Uri.parse("kernelsu://webui/$id"))
|
||||
.putExtra("id", id)
|
||||
@@ -753,4 +757,4 @@ fun ModuleItemPreview() {
|
||||
hasActionScript = false
|
||||
)
|
||||
ModuleItem(EmptyDestinationsNavigator, module, true, "", {}, {}, {}, {})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user