new fetchID and periodic_immediate

This commit is contained in:
rustdesk
2022-11-29 22:36:35 +08:00
parent 60dcd96874
commit 6e1f8f0294
4 changed files with 15 additions and 22 deletions

View File

@@ -61,7 +61,7 @@ class _ConnectionPageState extends State<ConnectionPage>
}
}();
}
_updateTimer = Timer.periodic(Duration(seconds: 1), (timer) {
_updateTimer = periodic_immediate(Duration(seconds: 1), () async {
updateStatus();
});
_idFocusNode.addListener(() {

View File

@@ -461,7 +461,8 @@ class _DesktopHomePageState extends State<DesktopHomePage>
void initState() {
super.initState();
bind.mainStartGrabKeyboard();
_updateTimer = Timer.periodic(const Duration(seconds: 1), (timer) async {
_updateTimer = periodic_immediate(const Duration(seconds: 1), () async {
await gFFI.serverModel.fetchID();
final url = await bind.mainGetSoftwareUpdateUrl();
if (updateUrl != url) {
updateUrl = url;