Don't show claim code page after user submits or skips

This commit is contained in:
Alex Liebowitz 2016-09-02 03:08:46 -04:00
parent c8220e0c08
commit 0844cbd14a
2 changed files with 6 additions and 6 deletions

View file

@ -4,9 +4,8 @@ var init = function() {
ReactDOM.render(
<SplashScreen message="Connecting" onLoadDone={function() {
// On home page, if the balance is 0, display claim code page instead of home page.
// Find somewhere better for this logic
if (window.location.search == '' || window.location.search == '?' || window.location.search == 'discover') {
// Redirect to the claim code page if needed. Find somewhere better for this logic
if (!localStorage.getItem('claimCodeDone') && window.location.search == '' || window.location.search == '?' || window.location.search == 'discover') {
lbry.getBalance((balance) => {
if (balance <= 0) {
window.location.href = '?claim';

View file

@ -39,8 +39,8 @@ var ClaimCodePage = React.createClass({
if (response.success) {
alert('Your invite code has been redeemed! The credits will be added to your balance shortly.');
// Send them to "landing" instead of "home" (home will just trigger the message all over again until the credits arrive)
window.location = '?landing';
localStorage.setItem('claimCodeDone', true);
window.location = '?home';
} else {
alert(response.reason);
this.setState({
@ -66,7 +66,8 @@ var ClaimCodePage = React.createClass({
},
handleSkip: function() {
alert('Welcome to LBRY! You can visit the Wallet page to redeem an invite code at any time.');
window.location = '?landing';
localStorage.setItem('claimCodeDone', true);
window.location = '?home';
},
render: function() {
return (