0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +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() {
return {
brew : {
text : '',
welcomeText : ''
text : '',
},
ver : '0.0.0'
};
},
getInitialState : function() {
return {
brew : this.props.brew
brew : this.props.brew,
welcomeText : this.props.brew.text
};
},
handleSave : function(){
@@ -85,7 +85,7 @@ const HomePage = createClass({
</SplitPane>
</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' />
</div>

View File

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