optimize delayTest

This commit is contained in:
chen08209
2024-05-17 15:39:41 +08:00
parent 9a07c785f2
commit c4b470ffaf
8 changed files with 95 additions and 102 deletions

View File

@@ -38,8 +38,16 @@ class _ClashMessageContainerState extends State<ClashMessageContainer>
@override
void onDelay(Delay delay) {
globalState.healthcheckLock = true;
final appController = globalState.appController;
appController.setDelay(delay);
globalState.healthcheckLockDebounce ??= debounce<Function()>(
() async {
globalState.healthcheckLock = false;
},
milliseconds: 5000,
);
globalState.healthcheckLockDebounce!();
super.onDelay(delay);
}