fix(xo-web/xoa): don't show expired notifications (#5304)

This commit is contained in:
Pierre Donias
2020-10-01 16:40:27 +02:00
committed by GitHub
parent 3616b7a67b
commit fdeab86a87
2 changed files with 6 additions and 1 deletions

View File

@@ -13,6 +13,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [XOA/Notifications] Don't show expired notifications (PR [#5304](https://github.com/vatesfr/xen-orchestra/pull/5304))
### Packages to release
> Packages will be released in the order they are here, therefore, they should

View File

@@ -424,7 +424,10 @@ export const subscribeNotifications = createSubscription(async () => {
let notifications
try {
notifications = await updater._call('getMessages')
const now = Date.now()
notifications = (await updater._call('getMessages')).filter(
({ expires }) => expires == null || expires > now
)
} catch (err) {
return []
}