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 armv7a committed Dec 27, 2024
1 parent 37767fb commit fe97a1e
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ fun ModuleScreen(navigator: DestinationsNavigator) {

var zipUri by remember { mutableStateOf<Uri?>(null) }
var showConfirmDialog by remember { mutableStateOf(false) }

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

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

0 comments on commit fe97a1e

Please sign in to comment.