project-error / npwd

NPWD is a FiveM phone resource written entirely in TypeScript and React.
https://projecterror.dev
Other
338 stars 277 forks source link

Twitter: Broadcast twitter add / remove like and notify user when their tweet is liked #1022

Closed BackSH00TER closed 1 year ago

BackSH00TER commented 1 year ago

Pull Request Description Problem: When a tweet is liked or a like is removed from a tweet, other users do not see the tweet count changing. A user only sees the count change locally from their own like/remove like.

This PR solves this problem by broadcasting the add/remove like to all players so that the counts are accurately reflected on all clients and are kept up to date.

Additionally this PR adds a notification when a user's tweet is liked. Notifications will only show if the user is not currently looking at the twitter app. image

Demo: https://clipchamp.com/watch/sEdY6bgbSMa

Note: The notification playSound relies on the change presented in this PR: https://github.com/project-error/npwd/pull/1023

Pull Request Checklist: