You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever a detail view of a team/alumni is opened, a view counter is incremented in the back-end. But there is some problem with its implementation as of now as it is not the best way and seems more like hack.
When one clicks the profile, an entry in the localStorage is created with key as the handle of the maintainer and value as the timestamp. This is done because the component is usually mounted 3 times so it sends 3 PUT requests which increment the counter by 3. This hack, thus, checks the time of "last visit" and if it is more than 5 seconds, only then it shall increment.
Obviously a better implementation is needed. 😛
The text was updated successfully, but these errors were encountered:
Whenever a detail view of a team/alumni is opened, a view counter is incremented in the back-end. But there is some problem with its implementation as of now as it is not the best way and seems more like hack.
When one clicks the profile, an entry in the
localStorage
is created with key as the handle of the maintainer and value as the timestamp. This is done because the component is usually mounted 3 times so it sends 3PUT
requests which increment the counter by 3. This hack, thus, checks the time of "last visit" and if it is more than 5 seconds, only then it shall increment.Obviously a better implementation is needed. 😛
The text was updated successfully, but these errors were encountered: