mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
Merge pull request #878 from safing/fix/broadcast-repeating
Fix repeating broadcast notifications
This commit is contained in:
commit
60ba013d1d
1 changed files with 4 additions and 3 deletions
|
@ -159,11 +159,12 @@ func handleBroadcast(bn *BroadcastNotification, matchingDataAccessor accessor.Ac
|
||||||
switch {
|
switch {
|
||||||
case !ok || state.Read.IsZero():
|
case !ok || state.Read.IsZero():
|
||||||
// Was never shown, continue.
|
// Was never shown, continue.
|
||||||
case bn.repeatDuration == 0 && !state.Read.IsZero():
|
case bn.repeatDuration == 0:
|
||||||
// Was already shown and is not repeated, skip.
|
// Was already shown and is not repeated, skip.
|
||||||
return ErrSkipAlreadyShown
|
return ErrSkipAlreadyShown
|
||||||
case bn.repeatDuration > 0 && time.Now().Add(-bn.repeatDuration).After(state.Read):
|
case time.Now().Before(state.Read.Add(bn.repeatDuration)):
|
||||||
// Was already shown, but should be repeated now, continue.
|
// Was already shown and should be repeated - but not yet, skip.
|
||||||
|
return ErrSkipAlreadyShown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue