Make sure (re)scan buttons show up immediately after uploading an image #256
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.
Description of the Change
Right now, if you upload an image directly to the media library and then click on that image to open the modal view, the scan/rescan buttons won't show up. You have to refresh the page before you see those.
The issue here is we have a check for the current screen and only show those buttons if the screen object doesn't exist. Not sure the historical context here but this does force a page refresh to see those settings, which is not ideal.
In testing, I don't see any issues with removing that check and it does fix the problem.
Alternate Designs
None
Benefits
Scan buttons show up immediately, without requiring a page refresh
Possible Drawbacks
Whatever the original reason there was for adding this check (for instance, to solve some sort of error), that could happen again, now that the check is gone. I've not run into any issues testing this though.
Verification Process
In the media library grid view, upload a new image and then click on that image to open the modal view. Ensure the scan buttons are showing up.
Checklist: