0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

Fix loading Style data from local storage, and add fix for Linter.

This commit is contained in:
G.Ambatte
2021-06-21 20:14:58 +12:00
parent 09c7f45c69
commit 142c9ad3b7

View File

@@ -1,3 +1,4 @@
/*eslint max-lines: ["warn", {"max": 300, "skipBlankLines": true, "skipComments": true}]*/
require('./newPage.less');
const React = require('react');
const createClass = require('create-react-class');
@@ -77,13 +78,13 @@ const NewPage = createClass({
this.setState({
brew : { text: brewStorage }
});
}
};
const styleStorage = localStorage.getItem(STYLEKEY);
if(!this.props.brew.text && styleStorage){
if(!this.props.brew.style && styleStorage){
this.setState({
brew : { style: styleStorage }
});
}
};
this.setState((prevState)=>({
htmlErrors : Markdown.validate(prevState.brew.text)