♻️ Simplify expressiono

This commit is contained in:
Marcell Fülöp 2022-06-19 21:04:29 +00:00
parent 168fe94391
commit ee46f2a33e
1 changed files with 3 additions and 5 deletions

View File

@ -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);
});
},