diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 180891d5f..cb3faf163 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -3124,6 +3124,15 @@ void onCopyFingerprint(String value) { } } +void onCopyId(String value) { + if (value.isNotEmpty) { + Clipboard.setData(ClipboardData(text: value)); + showToast('$value\n${translate("Copied")}'); + } else { + showToast(translate("Invalid ID")); + } +} + Future callMainCheckSuperUserPermission() async { bool checked = await bind.mainCheckSuperUserPermission(); if (isMacOS) { diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart index 5b925d947..fa5917056 100644 --- a/flutter/lib/common/widgets/dialog.dart +++ b/flutter/lib/common/widgets/dialog.dart @@ -352,9 +352,6 @@ void changeIdWhiteList({Function()? callback}) async { msg = ""; isInProgress = true; }); - debugPrint( - '[id-whitelist] raw=${controller.text.replaceAll(' ', '␠').replaceAll('\n', r'\n')}', - ); newIdWhiteListField = controller.text.trim(); var newIdWhiteList = ""; if (newIdWhiteListField.isEmpty) { @@ -365,7 +362,6 @@ void changeIdWhiteList({Function()? callback}) async { .split(RegExp(r"[\s,;\n]+")) .where((e) => e.isNotEmpty) .toList(); - debugPrint('[id-whitelist] ids=$ids'); // test id, wildcards '*' and '?' are allowed; // '@' '.' ':' '/' '[' ']' occur in cross-server IDs and WebSocket URIs final idMatch = RegExp(r"^[a-zA-Z0-9_*?@.:/\[\]-]+$"); @@ -383,7 +379,6 @@ void changeIdWhiteList({Function()? callback}) async { if (newIdWhiteList.trim().isEmpty) { newIdWhiteList = defaultOptionWhitelist; } - debugPrint('[id-whitelist] normalized=$newIdWhiteList'); await bind.mainSetOption( key: kOptionIdWhitelist, value: newIdWhiteList); callback?.call(); diff --git a/flutter/lib/mobile/pages/settings_page.dart b/flutter/lib/mobile/pages/settings_page.dart index 9c2fcda1f..cbc99fd2b 100644 --- a/flutter/lib/mobile/pages/settings_page.dart +++ b/flutter/lib/mobile/pages/settings_page.dart @@ -1015,7 +1015,7 @@ class _SettingsState extends State with WidgetsBindingObserver { ), leading: Icon(Icons.fingerprint)), SettingsTile( - onPressed: (context) => onCopyFingerprint(_myId), + onPressed: (context) => onCopyId(_myId), title: Text(translate("ID")), value: Padding( padding: EdgeInsets.symmetric(vertical: 8),