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

View file

@ -39,8 +39,8 @@ var ClaimCodePage = React.createClass({
if (response.success) { if (response.success) {
alert('Your invite code has been redeemed! The credits will be added to your balance shortly.'); 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) localStorage.setItem('claimCodeDone', true);
window.location = '?landing'; window.location = '?home';
} else { } else {
alert(response.reason); alert(response.reason);
this.setState({ this.setState({
@ -66,7 +66,8 @@ var ClaimCodePage = React.createClass({
}, },
handleSkip: function() { handleSkip: function() {
alert('Welcome to LBRY! You can visit the Wallet page to redeem an invite code at any time.'); 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() { render: function() {
return ( return (