From 24d339b5832cfdef8b9b2987740f20e5b93d051b Mon Sep 17 00:00:00 2001 From: Job Evers-Meltzer Date: Tue, 24 Jan 2017 22:20:41 -0500 Subject: [PATCH] only show the splash screen on initial load --- js/component/splash.js | 1 + js/main.js | 37 ++++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/js/component/splash.js b/js/component/splash.js index 29cb65234..bba92e288 100644 --- a/js/component/splash.js +++ b/js/component/splash.js @@ -28,6 +28,7 @@ var SplashScreen = React.createClass({ }); lbry.resolveName('one', () => { + window.sessionStorage.setItem('loaded', 'y') this.props.onLoadDone(); }); return; diff --git a/js/main.js b/js/main.js index d5cb1ab57..e03313718 100644 --- a/js/main.js +++ b/js/main.js @@ -13,24 +13,27 @@ var init = function() { } var canvas = document.getElementById('canvas'); - - ReactDOM.render( - { - if (balance <= 0) { - window.location.href = '?claim'; - } else { + if (window.sessionStorage.getItem('loaded') == 'y') { + ReactDOM.render(, canvas) + } else { + ReactDOM.render( + { + if (balance <= 0) { + window.location.href = '?claim'; + } else { + ReactDOM.render(, canvas); + } + }); + } else { ReactDOM.render(, canvas); - } - }); - } else { - ReactDOM.render(, canvas); - } - }}/>, - canvas - ); + } + }}/>, + canvas + ); + } }; init();