Commit 616e99c6 authored by Ray Schamp's avatar Ray Schamp

Only show "Welcome" panel if user is < 2 weeks old

Or if they've dismissed it. Fixes GH-153.
parent 0b47ac87
...@@ -99,6 +99,13 @@ var Splash = injectIntl(React.createClass({ ...@@ -99,6 +99,13 @@ var Splash = injectIntl(React.createClass({
if (!err) window.refreshSession(); if (!err) window.refreshSession();
}); });
}, },
shouldShowWelcome: function () {
if (!this.state.session.user || !this.state.session.flags.show_welcome) return false;
return (
new Date(this.state.session.user.dateJoined) >
new Date(new Date - 2*7*24*60*60*1000) // Two weeks ago
);
},
renderHomepageRows: function () { renderHomepageRows: function () {
var formatMessage = this.props.intl.formatMessage; var formatMessage = this.props.intl.formatMessage;
...@@ -244,7 +251,7 @@ var Splash = injectIntl(React.createClass({ ...@@ -244,7 +251,7 @@ var Splash = injectIntl(React.createClass({
<div className="inner"> <div className="inner">
{this.state.session.user ? [ {this.state.session.user ? [
<div key="header" className="splash-header"> <div key="header" className="splash-header">
{this.state.session.flags.show_welcome ? [ {this.shouldShowWelcome() ? [
<Welcome key="welcome" onDismiss={this.handleDismiss.bind(this, 'welcome')}/> <Welcome key="welcome" onDismiss={this.handleDismiss.bind(this, 'welcome')}/>
] : [ ] : [
<Activity key="activity" items={this.state.activity} /> <Activity key="activity" items={this.state.activity} />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment