mirror of
https://github.com/safing/portbase
synced 2025-09-04 19:50:18 +00:00
Ensure new notifications are active
This commit is contained in:
parent
643d67aff4
commit
a1461866c1
1 changed files with 5 additions and 0 deletions
|
@ -176,6 +176,11 @@ func (n *Notification) save(pushUpdate bool) *Notification {
|
||||||
n.Expires = time.Now().Add(72 * time.Hour).Unix()
|
n.Expires = time.Now().Add(72 * time.Hour).Unix()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure we always have a notification state assigned.
|
||||||
|
if n.State == "" {
|
||||||
|
n.State = Active
|
||||||
|
}
|
||||||
|
|
||||||
// check key
|
// check key
|
||||||
if n.DatabaseKey() == "" {
|
if n.DatabaseKey() == "" {
|
||||||
n.SetKey(fmt.Sprintf("notifications:all/%s", n.EventID))
|
n.SetKey(fmt.Sprintf("notifications:all/%s", n.EventID))
|
||||||
|
|
Loading…
Add table
Reference in a new issue