Skip to content

Commit

Permalink
[default-layout] Use visibilityState to hide loadingScreen. Fixes #459 (
Browse files Browse the repository at this point in the history
#573)

* [default-layout] Use visibilityState to hide loadingScreen. Fixes #459

* [default-layout] OR, not AND
  • Loading branch information
Kristoffer J. Sivertsen authored Feb 9, 2018
1 parent ae7f208 commit 41cd02a
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,18 @@ export default withRouterHOC(
}
})


return (
<div
className={`${styles.defaultLayout} ${mobileMenuIsOpen ? styles.mobileMenuIsOpen : ''}`}>
{this.state.showLoadingScreen && (
<div
className={this.state.loaded ? styles.loadingScreenLoaded : styles.loadingScreen}


className={
this.state.loaded || document.visibilityState == 'hidden'
? styles.loadingScreenLoaded
: styles.loadingScreen
}
ref={this.setLoadingScreenElement}>
<AppLoadingScreen text="Restoring Sanity" />
</div>
Expand Down

0 comments on commit 41cd02a

Please sign in to comment.