Servers: name a machine after its hostname once it connects
A saved server still named by the app ('My server', 'This server',
'Original legacy server' or its address host/IP) takes the hostname the
machine reports in get_status the first time the app connects; typed
names are kept. New servers (legacy migration, Settings with a blank
name, onboarding) start with the address host. A browser on its page
origin with no saved profile shows the reported hostname too. No server
change: get_status already reports the hostname.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -65,11 +65,13 @@ class SingleTerminalMachines extends ValueNotifier<List<TerminalMachine>> {
|
||||
}
|
||||
|
||||
final Listenable connection;
|
||||
final TerminalMachine machine;
|
||||
|
||||
/// The machine as named now; [connection] also notifies a rename.
|
||||
final TerminalMachine Function() machine;
|
||||
final bool Function() connected;
|
||||
|
||||
void _update() {
|
||||
final next = connected() ? [machine] : const <TerminalMachine>[];
|
||||
final next = connected() ? [machine()] : const <TerminalMachine>[];
|
||||
if (!_same(next, value)) value = next;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user