mirror of
https://github.com/safing/portbase
synced 2025-09-02 02:29:59 +00:00
Merge pull request #88 from safing/fix/notification-state
Fix/notification state
This commit is contained in:
commit
5e55b66e6d
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