This commit is contained in:
rustdesk 2024-07-18 11:24:43 +08:00
parent e9c8ba5393
commit edc5d86ee7

View File

@ -410,9 +410,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
} }
Future<Widget> buildHelpCards() async { Future<Widget> buildHelpCards() async {
if (bind.mainGetLocalOption(key: 'hide-help-cards') == 'Y') {
return const SizedBox();
}
if (!bind.isCustomClient() && if (!bind.isCustomClient() &&
updateUrl.isNotEmpty && updateUrl.isNotEmpty &&
!isCardClosed && !isCardClosed &&
@ -446,14 +443,14 @@ class _DesktopHomePageState extends State<DesktopHomePage>
}); });
} }
} else if (isMacOS) { } else if (isMacOS) {
if (!(bind.isOutgoingOnly() || final isOutgoingOnly = bind.isOutgoingOnly();
bind.mainIsCanScreenRecording(prompt: false))) { if (!(isOutgoingOnly || bind.mainIsCanScreenRecording(prompt: false))) {
return buildInstallCard("Permissions", "config_screen", "Configure", return buildInstallCard("Permissions", "config_screen", "Configure",
() async { () async {
bind.mainIsCanScreenRecording(prompt: true); bind.mainIsCanScreenRecording(prompt: true);
watchIsCanScreenRecording = true; watchIsCanScreenRecording = true;
}, help: 'Help', link: translate("doc_mac_permission")); }, 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", return buildInstallCard("Permissions", "config_acc", "Configure",
() async { () async {
bind.mainIsProcessTrusted(prompt: true); bind.mainIsProcessTrusted(prompt: true);
@ -465,7 +462,8 @@ class _DesktopHomePageState extends State<DesktopHomePage>
bind.mainIsCanInputMonitoring(prompt: true); bind.mainIsCanInputMonitoring(prompt: true);
watchIsInputMonitoring = true; watchIsInputMonitoring = true;
}, help: 'Help', link: translate("doc_mac_permission")); }, help: 'Help', link: translate("doc_mac_permission"));
} else if (!svcStopped.value && } else if (!isOutgoingOnly &&
!svcStopped.value &&
bind.mainIsInstalled() && bind.mainIsInstalled() &&
!bind.mainIsInstalledDaemon(prompt: false)) { !bind.mainIsInstalledDaemon(prompt: false)) {
return buildInstallCard("", "install_daemon_tip", "Install", () async { return buildInstallCard("", "install_daemon_tip", "Install", () async {
@ -548,6 +546,10 @@ class _DesktopHomePageState extends State<DesktopHomePage>
String? link, String? link,
bool? closeButton, bool? closeButton,
String? closeOption}) { String? closeOption}) {
if (bind.mainGetLocalOption(key: 'hide-help-cards') == 'Y' &&
content != 'install_daemon_tip') {
return const SizedBox();
}
void closeCard() async { void closeCard() async {
if (closeOption != null) { if (closeOption != null) {
await bind.mainSetLocalOption(key: closeOption, value: 'N'); await bind.mainSetLocalOption(key: closeOption, value: 'N');