mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-22 18:56:54 +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:
1 parent
3358094319
commit
5b242989da
3 files changed
+1
-4
No files matched your search
@@ -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