fix(xo-web/xoa): don't show expired notifications (#5304)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user