Closed ndelangen closed 1 year ago
They only update when we've polled for new data. The mutation should trigger a rerun of the query.
Hmmm.. I'm not sure.. it seems like there should also really be some sort of loading indicator? @ghengeveld How do you feel we should solve this?
it seems like there should also really be some sort of loading indicator?
There is a loading indicator, it appears while the mutation is running. It just doesn't show up while the rerun query is running, so you see "Accept" again for a moment.
I'm happy to move on for now and reconsider these UX nuances later for sure, btw. But to do what we want here I think we'd do something like:
const [isReviewing, setIsReviewing] = useState(false);
onAccepting = async () => {
try {
setIsReviewing(true);
await reviewTest(...)
await rerun();
} finally {
setIsReviewing(false);
}
}
So not super complicated IMO.
@tmeasday when I added rerun()
I wondered if I should await
it.. and I decided it should not, because rerun
(according to types) is not an async function.
What I did
As per @tmeasday's suggestion: I added a call to
rerun()
to theonAccept
&onUnaccept
callbacks making mutationHow to test
un-accept the change, assert this toggles to unreviewed state fast
📦 Published PR as canary version:
0.0.62--canary.86.a78ce21.0
:sparkles: Test out this PR locally via: ```bash npm install @chromaui/addon-visual-tests@0.0.62--canary.86.a78ce21.0 # or yarn add @chromaui/addon-visual-tests@0.0.62--canary.86.a78ce21.0 ```