Don't show claim code page after user submits or skips
This commit is contained in:
parent
c8220e0c08
commit
0844cbd14a
2 changed files with 6 additions and 6 deletions
|
@ -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';
|
||||
|
|
|
@ -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 (
|
||||
|
|
Loading…
Add table
Reference in a new issue