Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

538 no double votes #546

Merged
merged 5 commits into from
Apr 6, 2025
Merged

538 no double votes #546

merged 5 commits into from
Apr 6, 2025

Conversation

thomasgwatson
Copy link
Collaborator

Closes #538

@@ -417,6 +417,68 @@ export default function ChatRoom (props) {
messageListRef.current?.data.map((item) => post.id === item.id || (post.localId && post.localId === item.localId) ? newPost : item)
}, [group?.id])

const onAddProposalVote = useCallback(({ post, optionId }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great for now, but im realizing this is a lot of stuff we have to do for every single action that could update a post card in the chat stream. there are more and there will be more i think. so im wondering if we can generalize this and just have a function that takes the optimistically updated post data in the redux store and does a general replace of the whole post data in the chats with that 🤔 just a pondering for the future

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is an URQL conversion in the future for Web, I think you'll find that all of this will be handle implicitly as a function of graph cache.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this was inspired me checking about tracks/actions going into the chat...

It'll get out of hand real fast.

As Loren said, might be good justification to push for urql here sooner rather than later

@thomasgwatson thomasgwatson merged commit 7fd98b3 into dev Apr 6, 2025
1 of 2 checks passed
@thomasgwatson thomasgwatson deleted the 538-no-double-votes branch April 6, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Voting on a proposal in the chat room does not update the UI immediately, which also allows for multiple votes
3 participants