mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-29 01:59:07 +02:00
Merge branch 'main' into file-share
# Conflicts: # client/ios/NetBirdSDK/client.go
This commit is contained in:
@@ -278,12 +278,23 @@ func (t *Tray) dismissSessionWarning() {
|
||||
}
|
||||
|
||||
// openSessionExpiration fires the fallback dialog when the earlier warning notification wasn't dismissed.
|
||||
// Idempotent on the WindowManager side.
|
||||
func (t *Tray) openSessionExpiration() {
|
||||
// deadline is the absolute expiry from the warning event's metadata; when zero (older daemon,
|
||||
// malformed metadata) the cached status-snapshot deadline fills in. Idempotent on the
|
||||
// WindowManager side.
|
||||
func (t *Tray) openSessionExpiration(deadline time.Time) {
|
||||
if t.svc.WindowManager == nil {
|
||||
return
|
||||
}
|
||||
t.svc.WindowManager.OpenSessionExpiration(finalWarningCountdownSeconds)
|
||||
if deadline.IsZero() {
|
||||
t.sessionMu.Lock()
|
||||
deadline = t.sessionExpiresAt
|
||||
t.sessionMu.Unlock()
|
||||
}
|
||||
var deadlineMs int64
|
||||
if !deadline.IsZero() {
|
||||
deadlineMs = deadline.UnixMilli()
|
||||
}
|
||||
t.svc.WindowManager.OpenSessionExpiration(finalWarningCountdownSeconds, deadlineMs)
|
||||
}
|
||||
|
||||
// openSessionExtendFlow opens the SessionExpiration window seeded with the cached deadline's remaining time,
|
||||
@@ -304,5 +315,5 @@ func (t *Tray) openSessionExtendFlow() {
|
||||
if t.svc.WindowManager == nil {
|
||||
return
|
||||
}
|
||||
t.svc.WindowManager.OpenSessionExpiration(seconds)
|
||||
t.svc.WindowManager.OpenSessionExpiration(seconds, deadline.UnixMilli())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user