From edc5d86ee7fb9a8c48c34873398e681a5b0588d6 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Thu, 18 Jul 2024 11:24:43 +0800 Subject: [PATCH] fix hide-help-cards and fix https://github.com/rustdesk/rustdesk/issues/8687 --- flutter/lib/desktop/pages/desktop_home_page.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index 4a38a080b..addfacec3 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -410,9 +410,6 @@ class _DesktopHomePageState extends State } Future buildHelpCards() async { - if (bind.mainGetLocalOption(key: 'hide-help-cards') == 'Y') { - return const SizedBox(); - } if (!bind.isCustomClient() && updateUrl.isNotEmpty && !isCardClosed && @@ -446,14 +443,14 @@ class _DesktopHomePageState extends State }); } } else if (isMacOS) { - if (!(bind.isOutgoingOnly() || - bind.mainIsCanScreenRecording(prompt: false))) { + final isOutgoingOnly = bind.isOutgoingOnly(); + if (!(isOutgoingOnly || bind.mainIsCanScreenRecording(prompt: false))) { return buildInstallCard("Permissions", "config_screen", "Configure", () async { bind.mainIsCanScreenRecording(prompt: true); watchIsCanScreenRecording = true; }, help: 'Help', link: translate("doc_mac_permission")); - } else if (!bind.mainIsProcessTrusted(prompt: false)) { + } else if (!isOutgoingOnly && !bind.mainIsProcessTrusted(prompt: false)) { return buildInstallCard("Permissions", "config_acc", "Configure", () async { bind.mainIsProcessTrusted(prompt: true); @@ -465,7 +462,8 @@ class _DesktopHomePageState extends State bind.mainIsCanInputMonitoring(prompt: true); watchIsInputMonitoring = true; }, help: 'Help', link: translate("doc_mac_permission")); - } else if (!svcStopped.value && + } else if (!isOutgoingOnly && + !svcStopped.value && bind.mainIsInstalled() && !bind.mainIsInstalledDaemon(prompt: false)) { return buildInstallCard("", "install_daemon_tip", "Install", () async { @@ -548,6 +546,10 @@ class _DesktopHomePageState extends State String? link, bool? closeButton, String? closeOption}) { + if (bind.mainGetLocalOption(key: 'hide-help-cards') == 'Y' && + content != 'install_daemon_tip') { + return const SizedBox(); + } void closeCard() async { if (closeOption != null) { await bind.mainSetLocalOption(key: closeOption, value: 'N');