-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix race condition with isLoading
in use-data.hook.ts
#597
Labels
bug
Something isn't working
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When changing BCV repeatedly, the resource viewer will occasionally get stuck showing
Loading
instead of the right part of scripture. It appears to be related to theisLoading
flag in this part of theresource-viewer.web-view.tsx
:When the code is changed to ignore
isLoading
, the resource viewer continues to show scripture properly as expected.To Reproduce
Steps to reproduce the behavior:
isLoading
flag fromuse-data.hook.ts
.<
and/or>
button to change books and chapters in quick succession.Loading
. Changing BCV again usually clears it up after one or two updates, but sometimes it takes more.Expected behavior
The resource viewer should always update to scripture that matches the BCV control.
This is likely an issue with the pattern that people are expected to use
isLoading
fromuse-data.hook.ts
, not something specifically wrong with the resource viewer per se. Either there is a bug inuse-data.hook.ts
or the documentation is suggesting the use of return values in a way that is not thread safe across async calls.The text was updated successfully, but these errors were encountered: