0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-10 04:52:40 +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'); require('./newPage.less');
const React = require('react'); const React = require('react');
const createClass = require('create-react-class'); const createClass = require('create-react-class');
@@ -77,13 +78,13 @@ const NewPage = createClass({
this.setState({ this.setState({
brew : { text: brewStorage } brew : { text: brewStorage }
}); });
} };
const styleStorage = localStorage.getItem(STYLEKEY); const styleStorage = localStorage.getItem(STYLEKEY);
if(!this.props.brew.text && styleStorage){ if(!this.props.brew.style && styleStorage){
this.setState({ this.setState({
brew : { style: styleStorage } brew : { style: styleStorage }
}); });
} };
this.setState((prevState)=>({ this.setState((prevState)=>({
htmlErrors : Markdown.validate(prevState.brew.text) htmlErrors : Markdown.validate(prevState.brew.text)