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:
bryanyee33
2024-12-26 16:10:16 +08:00
committed by Rifat Azad
parent b638a068fc
commit 090ae7fb2d

View File

@@ -128,6 +128,10 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
var zipUri by remember { mutableStateOf<Uri?>(null) } var zipUri by remember { mutableStateOf<Uri?>(null) }
var showConfirmDialog by remember { mutableStateOf(false) } var showConfirmDialog by remember { mutableStateOf(false) }
val webUILauncher = rememberLauncherForActivityResult(
contract = ActivityResultContracts.StartActivityForResult()
) { viewModel.fetchModuleList() }
Scaffold( Scaffold(
topBar = { topBar = {
TopAppBar( TopAppBar(
@@ -226,7 +230,7 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
}, },
onClickModule = { id, name, hasWebUi -> onClickModule = { id, name, hasWebUi ->
if (hasWebUi) { if (hasWebUi) {
context.startActivity( webUILauncher.launch(
Intent(context, WebUIActivity::class.java) Intent(context, WebUIActivity::class.java)
.setData(Uri.parse("kernelsu-next://webui/$id")) .setData(Uri.parse("kernelsu-next://webui/$id"))
.putExtra("id", id) .putExtra("id", id)