manager: Remove Loading Dialog when enable/disable the module (#291)
Magic Mount is fast enough that there is almost no need to display a loading animation while waiting for the backend to finish processing. Signed-off-by: WenHao2130 <wenhao2130@outlook.com>
This commit is contained in:
@@ -843,10 +843,8 @@ private fun ModuleList(
|
|||||||
},
|
},
|
||||||
onCheckChanged = {
|
onCheckChanged = {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
val success = loadingDialog.withLoading {
|
val success = withContext(Dispatchers.IO) {
|
||||||
withContext(Dispatchers.IO) {
|
toggleModule(module.dirId, !module.enabled)
|
||||||
toggleModule(module.dirId, !module.enabled)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (success) {
|
if (success) {
|
||||||
viewModel.fetchModuleList()
|
viewModel.fetchModuleList()
|
||||||
|
|||||||
Reference in New Issue
Block a user