Skip to content

Commit

Permalink
manager: module: refresh after webui usage (tiann#2317)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanyee33 authored and itejo443 committed Dec 28, 2024
1 parent 11c14c7 commit e43cf10
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ fun ModuleScreen(navigator: DestinationsNavigator) {

val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState())

val webUILauncher = rememberLauncherForActivityResult(
contract = ActivityResultContracts.StartActivityForResult()
) { viewModel.fetchModuleList() }

Scaffold(
topBar = {
TopAppBar(
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -739,4 +743,4 @@ fun ModuleItemPreview() {
hasActionScript = false
)
ModuleItem(EmptyDestinationsNavigator, module, true, "", {}, {}, {}, {})
}
}

0 comments on commit e43cf10

Please sign in to comment.