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

Fix: Only execute viewer setup if not already setup #955

Merged
merged 8 commits into from
Mar 12, 2019

Conversation

ConradJChan
Copy link
Contributor

@ConradJChan ConradJChan commented Mar 11, 2019

Fixes an issue where if any viewer's attempt to download the content first fails and then succeeds the second attempt would run setup() twice and duplicate any DOM elements added to the bp-content div.

This fix decouples setup from load in the viewers and also checks an instance variable isSetup to determine whether setup needs to be executed again.

TODO:

  • unit tests
  • e2e tests

@boxcla
Copy link

boxcla commented Mar 11, 2019

Verified that @ConradJChan has signed the CLA. Thanks for the pull request!

jstoffan
jstoffan previously approved these changes Mar 11, 2019
jstoffan
jstoffan previously approved these changes Mar 12, 2019
Copy link
Collaborator

@jstoffan jstoffan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good to me. Make sure to test different scenarios (collections, retries, preload, etc.) to avoid any regressions.

@ConradJChan ConradJChan merged commit 8c2b193 into box:master Mar 12, 2019
@ConradJChan ConradJChan deleted the download-error branch March 12, 2019 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants