Closed ultraviolet10 closed 9 months ago
TODO:
read.ts
to match derive.ts
make check
After that, let's just merge this, I'll create an issue for the better UX of showing the status of drawing.
@norswap tried adding the timeout to the refreshGameData
calls, didn't retrigger the useEffect that performs the drawCard
functionality. ✌️
Great work, merging this (after rebasing on top of master) 🔥
I think we could improve it further.
e.g. the card appears before the animation in a way that is noticeable, would be great if the animation was more instantaneous with that event, and would also be great if the toast was dismissed immediately when that happens.
I think the main issue there is that the actual update occurs from the refreshGameState
whereas animation etc trigger from getting receipts from the transaction, which (at least locally) occurs after. I think this might need to happen as part of a bigger update on how we can signal those things via the first thing that occurs (state update OR getting receipts).
Also testing this I noticed the issue here #128
Refers to #107.
Adds in a
useEffect
inplay.tsx
that is triggered whenever the turn switches, and triggers thedrawCard
transaction. Removes theDraw
button since we're now automating the action.To test: keep ending turns in each tab, the tx is triggered in the other tab immediately (logs confirm this).
@norswap, would be nice to use this to indicate which card has been drawn? (when we have a definitive card list, with IDs and all).