Mobile: Fixes #11134: Fix automatic resource download mode #11144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Previously, automatic resource download was handled on component mount by checking the body of
this.state.note
. However at this point,this.state.note
is not set (setState
has been called, but this doesn't seem to setthis.state.note
immediately).This pull request moves the automatic resource download check to
componentDidUpdate
, whenstate.isLoading
goes fromfalse
totrue
. At present,isLoading
is set totrue
initially, then set tofalse
after loading a note.This pull request should fix #11134.
Important
Changes from #11145 is included in this pull request. This is to prevent CI failures related to new tests in this pull request. As such, most changes in this pull request are test-related.
Consider reviewing #11145 before this pull request.
If desired, I can create a separate pull request with just the change to
Note.tsx
that fixes the bug, without unit tests.Testing plan
This pull request adds an automated test.
Additionally, it has been tested manually on web (Chromium) by: