Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2204 from frankban/signup-expire
Browse files Browse the repository at this point in the history
Sign-up component: expire early if the user did not apply.
  • Loading branch information
jujugui authored Nov 17, 2016
2 parents 8eff0bf + 1562de4 commit 931c029
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,19 @@ YUI.add('deployment-signup', function() {
modelName: React.PropTypes.string.isRequired
},

_setBetaCookie: function() {
let expiration = new Date();
expiration.setMonth(expiration.getMonth() + 1);
/**
Set the cookie for hiding the sign-up page.
@method _setBetaCookie
@param {Boolean} permanent Whether the page must be permanently hidden.
*/
_setBetaCookie: function(permanent) {
const expiration = new Date();
if (permanent) {
expiration.setFullYear(2020);
} else {
expiration.setHours(expiration.getHours() + 3);
}
document.cookie = 'beta-signup-seen=true; expires='
+ expiration.toUTCString();
},
Expand All @@ -50,7 +60,7 @@ YUI.add('deployment-signup', function() {
}
}
});
this._setBetaCookie();
this._setBetaCookie(false);
},

/**
Expand All @@ -59,7 +69,7 @@ YUI.add('deployment-signup', function() {
@method _handleSignup
*/
_handleSignup: function() {
this._setBetaCookie();
this._setBetaCookie(true);
console.error('Not implemented.');
},

Expand Down

0 comments on commit 931c029

Please sign in to comment.