From ee46f2a33e914ccb813d9fc2ee53f47de5e7eace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcell=20F=C3=BCl=C3=B6p?= Date: Sun, 19 Jun 2022 21:04:29 +0000 Subject: [PATCH] :recycle: Simplify expressiono --- src/components/Widgets/NextcloudNotifications.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/Widgets/NextcloudNotifications.vue b/src/components/Widgets/NextcloudNotifications.vue index b05c983a..1c2278fe 100644 --- a/src/components/Widgets/NextcloudNotifications.vue +++ b/src/components/Widgets/NextcloudNotifications.vue @@ -91,11 +91,9 @@ export default { this.notifications = []; notifications.forEach((notification) => { if (limitCount && this.notifications.length === limitCount) return; // count limit - const notiDate = Date.parse(notification.datetime); - const now = new Date().getTime(); - if (limitTime && notiDate && now - notiDate > limitTime) { // time limit - return; - } + const notiTime = Date.parse(notification.datetime); + const nowTime = new Date().getTime(); + if (limitTime && notiTime && nowTime - notiTime > limitTime) return; // time limit this.notifications.push(notification); }); },