Deleting Notifications from the In-App Notification Center
I'm developing a website for a client and we're using the in-app notification center using React. He was asking about allowing users to delete or clear notifications after they've been read. Currently we can set them to 'read' status but not delete them.
I looked through the docs, and briefly looked through the codebase and didn't see anything about deleting in app notifications. Is there currently a way I didn't see?
We're using the cloud hosted version if that matters.
29 Replies
We're using a custom Item renderer so technically I could return an empty div when the notification has been read. Which fixes it 'visually' but the data is still being passed down to the website.
@bigheartedkb, you just advanced to level 2!
We definitely have plans to add delete(among other options) for a notification item
I have a suggestion that might help, just for now. You could use the stores - which are a way to query notifications for a parameter (like feedIdentifier and also seen state of notification) @bigheartedkb
That will query only the notifications that were not read yet
and then
@bigheartedkb my mannnn!!!!!
@davidsouthmountain I think you have added already the remove message enedpoint right?
Yes I did and it can be found here https://github.com/novuhq/novu/blob/main/apps/api/src/app/messages/messages.controller.ts#L75 π
@dimagrossman maybe we should add the Messages api tag to be shown in swagger json so it is shown in api doc?
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
Oh yes, looks like a mistake. We should add a Tag.
@florian_lefebvre mind adding a github issue for this? !issue
!issue
Want to report a bug or request a feature?
Let's open an issue. Just click here π
https://github.com/novuhq/novu/issues/new/choose
@dimagrossman
this solves that problem
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
@florian_lefebvre, you just advanced to level 4!
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
you could use refetch that useNotification expose?
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
@arc.13 could you see if this works now as well?
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
okay so lets see if we can solve this as well π
Can I close the other one?
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
nice then I close both of them π
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
@george.d do you recall by chance if we also expose unreadCount here?
I donβt believe we do at the moment. The toggle between seen/read on the notifications center is still missing.
Do you mind creating an issue for that?
Not sure if you meant me or someone else, but not problem at all i will create shortly π
Hopefully it is well detailed π
https://github.com/novuhq/novu/issues/2123
GitHub
[NV-1266] Notification-Center bell seen/read toggle Β· Issue #2123 Β·...
At the current state notification-center bell counter uses the seen count in order to present the bell dot and counter on the notification center header. What we want is the ability for the user of...