fix(xo-web/notifications): set cookie expiration date (#5067)

Without an expiration date, the cookie expires at the end of the session and
read notifications are marked as unread the next time the user connects.
This commit is contained in:
Pierre Donias
2020-06-11 12:34:33 +02:00
committed by GitHub
parent bbb359470e
commit 90db25d732
2 changed files with 4 additions and 1 deletions

View File

@@ -19,6 +19,7 @@
- [Home] Broken "Import VM" link [#5055](https://github.com/vatesfr/xen-orchestra/issues/5055) (PR [#5056](https://github.com/vatesfr/xen-orchestra/pull/5056))
- [Home/SR] Fix inability to edit SRs' name [#5057](https://github.com/vatesfr/xen-orchestra/issues/5057) (PR [#5058](https://github.com/vatesfr/xen-orchestra/pull/5058))
- [Backup] Fix huge logs in case of Continuous Replication or Disaster Recovery errors (PR [#5069](https://github.com/vatesfr/xen-orchestra/pull/5069))
- [Notification] Fix same notification showing again as unread (PR [#5067](https://github.com/vatesfr/xen-orchestra/pull/5067))
### Packages to release
@@ -39,3 +40,4 @@
- xo-server-load-balancer patch
- xo-server patch
- xo-web minor

View File

@@ -372,7 +372,8 @@ const setNotificationCookie = (id, changes) => {
})
cookies.set(
`notifications:${store.getState().user.id}`,
JSON.stringify(notifications)
JSON.stringify(notifications),
{ expires: Infinity }
)
}