An open-source cross-platform alternative to AirDrop
feat: use ComputerName instead of hostname on macOS (#2729)
Shlomo7a1bef4fbd86
diff --git a/app/lib/pages/tabs/settings_tab.dart b/app/lib/pages/tabs/settings_tab.dartindex f0d87c0e..68df3513 100644--- a/app/lib/pages/tabs/settings_tab.dart+++ b/app/lib/pages/tabs/settings_tab.dart@@ -351,8 +351,13 @@ class SettingsTab extends StatelessWidget {message: t.settingsTab.network.useSystemName,child: IconButton(onPressed: () async {- // Uses dart.io to find the systems hostname- final newAlias = Platform.localHostname;+ final String newAlias;+ if (Platform.isMacOS) {+ final result = await Process.run('scutil', ['--get', 'ComputerName']);+ newAlias = result.stdout.toString().trim();+ } else {+ newAlias = Platform.localHostname;+ }vm.aliasController.text = newAlias;await ref.notifier(settingsProvider).setAlias(newAlias);