From 14625d0794f4b9fd58206698a160e459dd8ef815 Mon Sep 17 00:00:00 2001 From: Viktor Liu Date: Thu, 18 Jan 2024 16:00:51 +0100 Subject: [PATCH] Hide last connection update time if it's zero --- client/cmd/status.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/cmd/status.go b/client/cmd/status.go index 8efb6898c0a..b93b04e8f92 100644 --- a/client/cmd/status.go +++ b/client/cmd/status.go @@ -513,6 +513,10 @@ func parsePeers(peers peersStateOutput) string { if peerState.IceCandidateEndpoint.Remote != "" { remoteICEEndpoint = peerState.IceCandidateEndpoint.Remote } + lastStatusUpdate := "-" + if !peerState.LastStatusUpdate.IsZero() { + lastStatusUpdate = peerState.LastStatusUpdate.Format("2006-01-02 15:04:05") + } lastWireguardHandshake := "-" if !peerState.LastWireguardHandshake.IsZero() { @@ -542,7 +546,7 @@ func parsePeers(peers peersStateOutput) string { remoteICE, localICEEndpoint, remoteICEEndpoint, - peerState.LastStatusUpdate.Format("2006-01-02 15:04:05"), + lastStatusUpdate, lastWireguardHandshake, toIEC(peerState.TransferReceived), toIEC(peerState.TransferSent),