fix: notification countdown now ticks locally every second instead of gated behind 5s server poll; bump to 1.0.5+9

This commit is contained in:
esefxdz committed 2026-07-17 13:17:47 +03:00
1 parent 259db2f386
commit 08f08fbf3e
2 files changed
+18 -14

No files matched your search

+17 -13
View File
@@ -189,6 +189,23 @@ class SessionTimer extends ChangeNotifier {
_syncWithHivemind();
}
// ── Update notification every tick for smooth countdown ─────────────
// Uses the locally-decremented time so the notification stays in sync
// with the in-app display, not gated behind the 5 s server poll.
if (_hasSyncedOnce) {
final speedText = _currentSpeedKBps > 0.5
? '${_currentSpeedKBps.toStringAsFixed(1)} KB/s'
: 'Idle';
if (formatted != _lastNotifTime || speedText != _lastNotifSpeed) {
_lastNotifTime = formatted;
_lastNotifSpeed = speedText;
VpnNotificationManager.showOrUpdateStatus(
timeLeft: formatted,
speedKbps: speedText,
);
}
}
notifyListeners();
}
@@ -250,19 +267,6 @@ class SessionTimer extends ChangeNotifier {
_offlineSeconds = 0;
_hasSyncedOnce = true;
// ── Update notification (only when values actually change) ─────────
final speedText = _currentSpeedKBps > 0.5
? '${_currentSpeedKBps.toStringAsFixed(1)} KB/s'
: 'Idle';
if (formatted != _lastNotifTime || speedText != _lastNotifSpeed) {
_lastNotifTime = formatted;
_lastNotifSpeed = speedText;
VpnNotificationManager.showOrUpdateStatus(
timeLeft: formatted,
speedKbps: speedText,
);
}
notifyListeners();
} else if (response.statusCode == 404) {
// Peer not found on server (expired / deleted natively)
+1 -1
View File
@@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.5+8
version: 1.0.5+9
environment:
sdk: ">=3.0.0 <4.0.0"