-
Notifications
You must be signed in to change notification settings - Fork 584
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
feat(EMI-2187): Refresh Bids screen every 10 secs #11407
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach is totally fine, but heads up that we use this usePoll
hook throughout a few of our codebases. Might be nice to add here as well: https://github.com/artsy/force/blob/main/src/Utils/Hooks/usePoll.ts
@damassi I saw that A good Future Friday project idea would be to consolidate them into one across our codebases :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L G T M
src/app/Scenes/MyBids/MyBids.tsx
Outdated
relay.refetch( | ||
{}, | ||
null, | ||
(error) => { | ||
if (error) { | ||
console.error("MyBids/index.tsx #refreshMyBids", error.message) | ||
// FIXME: Handle error | ||
} | ||
setIsFetching(false) | ||
}, | ||
{ force: true } | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: If we aren't going to handle it explicitly, could we send to sentry or otherwise know how often this happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! I'll add that
} | ||
|
||
useAppState({ | ||
onChange: (state) => { | ||
setAppIsInForeground(state === "active") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking: should "active"
be constantized/enumized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think since it's typed, it's okay to leave it as is?
Ah! Sorry @MrSltun - i read |
b95554e
to
8f4bb1b
Compare
This PR resolves EMI-2187
Description
This PR implements a
useInterval
in the Bids screen to update it every 10 secondsPR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.