diff --git a/lib/services/vpn_session_service.dart b/lib/services/vpn_session_service.dart index 927345c..cf39fb3 100644 --- a/lib/services/vpn_session_service.dart +++ b/lib/services/vpn_session_service.dart @@ -70,8 +70,15 @@ class VpnSessionService { return 'No handshake yet'; } else { final handshakeDateTime = DateTime.fromMillisecondsSinceEpoch(handshakeTime * 1000); + final now = DateTime.now(); + final duration = now.difference(handshakeDateTime); - return 'Last handshake: ${handshakeDateTime.toLocal()}'; + // Check if connection is dead (more than 2 minutes 30 seconds) + if (duration.inSeconds > 150) { + return 'DEAD - Last handshake: ${handshakeDateTime.toLocal()} (${duration.inMinutes}m ${duration.inSeconds % 60}s ago)'; + } else { + return 'ALIVE - Last handshake: ${handshakeDateTime.toLocal()} (${duration.inSeconds}s ago)'; + } } } }