0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-10 09:12:39 +00:00

avoid sending two copies of welcome text in the same brew

This commit is contained in:
Trevor Buckner
2021-07-30 17:47:11 -04:00
parent 85fa73b9bf
commit 99d2f6d48d
2 changed files with 5 additions and 6 deletions

View File

@@ -23,15 +23,15 @@ const HomePage = createClass({
getDefaultProps : function() { getDefaultProps : function() {
return { return {
brew : { brew : {
text : '', text : '',
welcomeText : ''
}, },
ver : '0.0.0' ver : '0.0.0'
}; };
}, },
getInitialState : function() { getInitialState : function() {
return { return {
brew : this.props.brew brew : this.props.brew,
welcomeText : this.props.brew.text
}; };
}, },
handleSave : function(){ handleSave : function(){
@@ -85,7 +85,7 @@ const HomePage = createClass({
</SplitPane> </SplitPane>
</div> </div>
<div className={cx('floatingSaveButton', { show: this.props.brew.welcomeText != this.state.brew.text })} onClick={this.handleSave}> <div className={cx('floatingSaveButton', { show: this.state.welcomeText != this.state.brew.text })} onClick={this.handleSave}>
Save current <i className='fas fa-save' /> Save current <i className='fas fa-save' />
</div> </div>

View File

@@ -108,8 +108,7 @@ app.get('/robots.txt', (req, res)=>{
//Home page //Home page
app.get('/', async (req, res, next)=>{ app.get('/', async (req, res, next)=>{
const brew = { const brew = {
text : welcomeText, text : welcomeText
welcomeText : welcomeText
}; };
req.brew = brew; req.brew = brew;
return next(); return next();