mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-19 08:23:01 +08:00
fix custom client show ip whiltelist warning (#8778)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
4723d6a830
commit
22f3425ace
@ -3425,6 +3425,12 @@ get defaultOptionWhitelist => isCustomClient ? ',' : '';
|
||||
get defaultOptionAccessMode => isCustomClient ? 'custom' : '';
|
||||
get defaultOptionApproveMode => isCustomClient ? 'password-click' : '';
|
||||
|
||||
bool whitelistNotEmpty() {
|
||||
// https://rustdesk.com/docs/en/self-host/client-configuration/advanced-settings/#whitelist
|
||||
final v = bind.mainGetOptionSync(key: kOptionWhitelist);
|
||||
return v != '' && v != ',';
|
||||
}
|
||||
|
||||
// `setMovable()` is only supported on macOS.
|
||||
//
|
||||
// On macOS, the window can be dragged by the tab bar by default.
|
||||
|
@ -1119,12 +1119,9 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
bool enabled = !locked;
|
||||
// Simple temp wrapper for PR check
|
||||
tmpWrapper() {
|
||||
RxBool hasWhitelist = (bind.mainGetOptionSync(key: kOptionWhitelist) !=
|
||||
defaultOptionWhitelist)
|
||||
.obs;
|
||||
RxBool hasWhitelist = whitelistNotEmpty().obs;
|
||||
update() async {
|
||||
hasWhitelist.value = bind.mainGetOptionSync(key: kOptionWhitelist) !=
|
||||
defaultOptionWhitelist;
|
||||
hasWhitelist.value = whitelistNotEmpty();
|
||||
}
|
||||
|
||||
onChanged(bool? checked) async {
|
||||
|
@ -97,8 +97,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
||||
kOptionEnableAbr, bind.mainGetOptionSync(key: kOptionEnableAbr));
|
||||
_denyLANDiscovery = !option2bool(kOptionEnableLanDiscovery,
|
||||
bind.mainGetOptionSync(key: kOptionEnableLanDiscovery));
|
||||
_onlyWhiteList = (bind.mainGetOptionSync(key: kOptionWhitelist)) !=
|
||||
defaultOptionWhitelist;
|
||||
_onlyWhiteList = whitelistNotEmpty();
|
||||
_enableDirectIPAccess = option2bool(
|
||||
kOptionDirectServer, bind.mainGetOptionSync(key: kOptionDirectServer));
|
||||
_enableRecordSession = option2bool(kOptionEnableRecordSession,
|
||||
@ -282,9 +281,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
||||
initialValue: _onlyWhiteList,
|
||||
onToggle: (_) async {
|
||||
update() async {
|
||||
final onlyWhiteList =
|
||||
(await bind.mainGetOption(key: kOptionWhitelist)) !=
|
||||
defaultOptionWhitelist;
|
||||
final onlyWhiteList = whitelistNotEmpty();
|
||||
if (onlyWhiteList != _onlyWhiteList) {
|
||||
setState(() {
|
||||
_onlyWhiteList = onlyWhiteList;
|
||||
|
Loading…
Reference in New Issue
Block a user