]> git.cworth.org Git - lmno.games/commit - empathy/empathy.jsx
Drop extra PromptOption state for not showing a specific prompt
authorCarl Worth <cworth@cworth.org>
Sun, 28 Jun 2020 21:44:47 +0000 (14:44 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 28 Jun 2020 21:44:47 +0000 (14:44 -0700)
commit410d32deceb2ca11d08265592acb1cc5495dd532
tree9e94d31848d8a795d32885feac4a0ed45c44a6dc
parent00002a9f80dae904c1629f2d0b06d2acc89e94bf
Drop extra PromptOption state for not showing a specific prompt

It was fun for me to learn about how to use the useState hook,
but this only code path was only necessary for when I was not
planning to distribute negative votes through the server to
other clients.

I ended up distributing that state after all, which has the benefit
that hidden prompts stay hidden when reloading (and from one round to
the next). [One potential downside is that hidden prompts are
permanently hidden---they can't be made to appear again. Oh well!]

And now that the server is telling us about the prompts we've already
voted against, and we're already not dispalying those, we don't need
the additional state here to hide things on the client side before we
receive that notification from the server.
empathy/empathy.jsx