🐛 Auto reconnect

This commit is contained in:
LittleSheep 2024-06-01 21:41:40 +08:00
parent e96b49e3cd
commit 99a51de9f6
2 changed files with 4 additions and 0 deletions

View File

@ -84,9 +84,11 @@ class AccountProvider extends GetxController {
},
onDone: () {
isConnected.value = false;
Future.delayed(const Duration(milliseconds: 1000), () => connect());
},
onError: (err) {
isConnected.value = false;
Future.delayed(const Duration(milliseconds: 1000), () => connect());
},
);
}

View File

@ -58,9 +58,11 @@ class ChatProvider extends GetxController {
},
onDone: () {
isConnected.value = false;
Future.delayed(const Duration(milliseconds: 1000), () => connect());
},
onError: (err) {
isConnected.value = false;
Future.delayed(const Duration(milliseconds: 1000), () => connect());
},
);
}