mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-09 03:31:29 +03:00
fix andriod update button cannot be clicked (#10394)
1. Remove `canLaunchUrl`, which fix the issue 2. Remove `unregisterEventHandler` of `kCheckSoftwareUpdateFinish` when connection page dispose, it's registered on main. Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -834,10 +834,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
_uniLinksSubscription?.cancel();
|
_uniLinksSubscription?.cancel();
|
||||||
Get.delete<RxBool>(tag: 'stop-service');
|
Get.delete<RxBool>(tag: 'stop-service');
|
||||||
_updateTimer?.cancel();
|
_updateTimer?.cancel();
|
||||||
if (!bind.isCustomClient()) {
|
|
||||||
platformFFI.unregisterEventHandler(
|
|
||||||
kCheckSoftwareUpdateFinish, kCheckSoftwareUpdateFinish);
|
|
||||||
}
|
|
||||||
WidgetsBinding.instance.removeObserver(this);
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
: InkWell(
|
: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final url = 'https://rustdesk.com/download';
|
final url = 'https://rustdesk.com/download';
|
||||||
// https://pub.dev/packages/url_launcher#configuration
|
// https://pub.dev/packages/url_launcher#configuration
|
||||||
// https://developer.android.com/training/package-visibility/use-cases#open-urls-custom-tabs
|
// https://developer.android.com/training/package-visibility/use-cases#open-urls-custom-tabs
|
||||||
//
|
//
|
||||||
// `await launchUrl(Uri.parse(url))` can also run if skip
|
// `await launchUrl(Uri.parse(url))` can also run if skip
|
||||||
@@ -115,9 +115,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
// 2. `<action android:name="android.support.customtabs.action.CustomTabsService" />` in AndroidManifest.xml
|
// 2. `<action android:name="android.support.customtabs.action.CustomTabsService" />` in AndroidManifest.xml
|
||||||
//
|
//
|
||||||
// But it is better to add the check.
|
// But it is better to add the check.
|
||||||
if (await canLaunchUrl(Uri.parse(url))) {
|
await launchUrl(Uri.parse(url));
|
||||||
await launchUrl(Uri.parse(url));
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: AlignmentDirectional.center,
|
alignment: AlignmentDirectional.center,
|
||||||
@@ -370,10 +368,6 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
if (Get.isRegistered<TextEditingController>()) {
|
if (Get.isRegistered<TextEditingController>()) {
|
||||||
Get.delete<TextEditingController>();
|
Get.delete<TextEditingController>();
|
||||||
}
|
}
|
||||||
if (!bind.isCustomClient()) {
|
|
||||||
platformFFI.unregisterEventHandler(
|
|
||||||
kCheckSoftwareUpdateFinish, kCheckSoftwareUpdateFinish);
|
|
||||||
}
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user