♻️ Simplify expressiono

This commit is contained in:
Marcell Fülöp 2022-06-19 21:04:29 +00:00
parent 168fe94391
commit ee46f2a33e

View File

@ -91,11 +91,9 @@ export default {
this.notifications = []; this.notifications = [];
notifications.forEach((notification) => { notifications.forEach((notification) => {
if (limitCount && this.notifications.length === limitCount) return; // count limit if (limitCount && this.notifications.length === limitCount) return; // count limit
const notiDate = Date.parse(notification.datetime); const notiTime = Date.parse(notification.datetime);
const now = new Date().getTime(); const nowTime = new Date().getTime();
if (limitTime && notiDate && now - notiDate > limitTime) { // time limit if (limitTime && notiTime && nowTime - notiTime > limitTime) return; // time limit
return;
}
this.notifications.push(notification); this.notifications.push(notification);
}); });
}, },