From f21f793343ab67cf2959d19a703352e011c5daf1 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 26 Sep 2023 10:47:45 +0800 Subject: [PATCH] remove check update from periodical call --- flutter/lib/desktop/pages/desktop_home_page.dart | 9 ++++----- flutter/lib/mobile/pages/connection_page.dart | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index e48dda51d..c5d3718eb 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -499,13 +499,12 @@ class _DesktopHomePageState extends State @override void initState() { super.initState(); + Timer(const Duration(seconds: 1), () async { + updateUrl = await bind.mainGetSoftwareUpdateUrl(); + if (updateUrl.isNotEmpty) setState(() {}); + }); _updateTimer = periodic_immediate(const Duration(seconds: 1), () async { await gFFI.serverModel.fetchID(); - final url = await bind.mainGetSoftwareUpdateUrl(); - if (updateUrl != url) { - updateUrl = url; - setState(() {}); - } final error = await bind.mainGetError(); if (systemError != error) { systemError = error; diff --git a/flutter/lib/mobile/pages/connection_page.dart b/flutter/lib/mobile/pages/connection_page.dart index 5a61a2fc8..c9bd15709 100644 --- a/flutter/lib/mobile/pages/connection_page.dart +++ b/flutter/lib/mobile/pages/connection_page.dart @@ -57,7 +57,7 @@ class _ConnectionPageState extends State { }(); } if (isAndroid) { - Timer(const Duration(seconds: 5), () async { + Timer(const Duration(seconds: 1), () async { _updateUrl = await bind.mainGetSoftwareUpdateUrl(); if (_updateUrl.isNotEmpty) setState(() {}); });