Skip to content
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

[MB-8798] Fix deprecation warning for progress callback in pdf getDocument method #5

Merged
merged 3 commits into from Jul 22, 2021

Conversation

duncan-truss
Copy link

When loading pdf documents in the file viewer, we would see a warning message about using the progress callback in the getDocument method in the browser console.

The recommended fix is to no longer pass in a progress callback method to that function but to define the onProgress function property on the returned loading task promise.

To test the new fix you should be able to run yarn start and visit localhost:8081 from this repository. The sample pdf displayed is quite small and the loading happens really fast so it's difficult to test the loading indicator even for a larger file loaded from local disk. I did log out the calls to set state to confirm it's still being updated, it may be easier to test integrated as the MilMove document viewer or with a network file.

Please also review the PR in the mymove repo that uses this updated branch transcom/mymove#7036

Screen Shot 2021-07-21 at 11 11 27 AM

@duncan-truss duncan-truss merged commit fe70df7 into master Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants