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(
|
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';
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
Loading…
Add table
Reference in a new issue