Skip to content

DM-12208: Check if the document is loaded before rendering firefly #475

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

Merged
merged 1 commit into from
Oct 14, 2017

Conversation

robyww
Copy link
Contributor

@robyww robyww commented Oct 12, 2017

to test:

Load firefly. It should work.

@robyww robyww self-assigned this Oct 12, 2017
@robyww robyww requested a review from loitly October 12, 2017 17:08
Copy link
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

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

It works great. Good to merge.

if (viewer) {
ReactDOM.render(React.createElement(viewer, props),
document.getElementById(props.div));
if (window.document.readyState==='complete' || window.document.readyState==='interactive') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be more straight forward if you were checking for 'loading' instead?

if (loading) 
 - add load listening

Copy link
Contributor Author

@robyww robyww Oct 14, 2017

Choose a reason for hiding this comment

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

Your right, that would look cleaner. Maybe it is because I am just not that familiar with readyState but I did it this way because it calls out that states I care about, therefore a little more self documenting. I think I will leave it this way for now.

@robyww robyww merged commit 1fc1f6e into dev Oct 14, 2017
@robyww robyww deleted the dm-12208-onload branch October 14, 2017 18:54
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.

2 participants