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:
1 parent
259db2f386
commit
08f08fbf3e
2 files changed
+18
-14
No files matched your search
@@ -189,6 +189,23 @@ class SessionTimer extends ChangeNotifier {
|
|||||||
_syncWithHivemind();
|
_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();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,19 +267,6 @@ class SessionTimer extends ChangeNotifier {
|
|||||||
_offlineSeconds = 0;
|
_offlineSeconds = 0;
|
||||||
_hasSyncedOnce = true;
|
_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();
|
notifyListeners();
|
||||||
} else if (response.statusCode == 404) {
|
} else if (response.statusCode == 404) {
|
||||||
// Peer not found on server (expired / deleted natively)
|
// Peer not found on server (expired / deleted natively)
|
||||||
|
|||||||
+1
-1
@@ -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.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.0.5+8
|
version: 1.0.5+9
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.0.0 <4.0.0"
|
sdk: ">=3.0.0 <4.0.0"
|
||||||
|
|||||||
Reference in new issue
Block a user