Y
Y
Yana2022-03-14 12:49:06
JavaScript
Yana, 2022-03-14 12:49:06

How to determine that the user has viewed the notification?

How can you tell if a user has opened a notification card in order to mark it as read?

Unread notifications - all that the user sees in the card for the first time.
When you open a card, notifications that are in view become read.

The user does not open notifications themselves.
There are two tabs for news #1 and news #2. Every minute a request is sent for new notifications.
For clarity, a screenshot of the prototype.

Perhaps there are some plugins or something similar on vue.
I would be very grateful for a hint in which direction to dig :)

622f0f6bd555d654055472.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2022-03-14
@YanaLins

for each element, add the isNew property. Then you go
over them when opening the notification panel and reset those that are placed in the container.
Optionally, add the New\All filter.
After the definition, send a request to the server with a status update, or store everything on the client, for example, in local storage

S
skuvaWeb, 2022-03-14
@skuvaWeb

In addition to the answer above - you'll need the Intersection API
To detect when a post is visible to the user - send a request that it's "read"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question