Closed sepehr2github closed 2 years ago
Let me know if any changes needed.
Thanks! Please resolve conflicts. Also, how to add a notification?
@anon-real So you can add your new notifications to "data" array in "notification" key (local Storage), example:
{ data:[{message:'test',link:'https://test.com'}], unread:1 }
Do not forget to increase "unread" value for new notifications
It shouldn't need a refresh to show the notification badge. Also, one nice addition is to show a sticky message when unread is increased (new notifications are added) that "You have new notifications"
Also, let's also show the time of the notification. So the new notification json will be sth like:
{ data:[{message:'test',link:'https://test.com', status: 'error', time: 13438347374}], unread:1 }
Also, please reverse the list before showing. Latest should be first.
Also, only show the last "unread" notification. If user wants to see previous notifications, there should be a button for that "load read notifications"
@anon-real maybe we can add new border with new tag :). something like discord new messsage
I will send new pull request with your desired features.
@anon-real maybe we can add new border with new tag :). something like discord new messsage
That is also fine. However, notifications can grow over time to hundreds. Also, I think it is good to fix the modal height and add scroll instead of it grow with notifications.
@sepehr2github I've added a 'addNotification' method in helper.js. You don't need to add that.
@sepehr2github Also, this may help, not sure though: https://stackoverflow.com/questions/26974084/listen-for-changes-with-localstorage-on-the-same-window