mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-14 23:42:41 +00:00
Handle cached text
The NEW page saves to the browser LocalStorage the current text in case the user goes to a different page before saving. The new "import" function wasn't working since it was being overwritten by any cached values if they existed from an earlier "new" page.
This commit is contained in:
@@ -61,7 +61,7 @@ const NewPage = createClass({
|
||||
|
||||
componentDidMount : function() {
|
||||
const storage = localStorage.getItem(KEY);
|
||||
if(storage){
|
||||
if(!this.props.brew.text && storage){
|
||||
this.setState({
|
||||
brew : { text: storage }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user