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:
Trevor Buckner committed 2021-03-04 22:58:40 -05:00
1 parent 3358094319
commit 5b242989da
3 files changed
+1 -4

No files matched your search

+1 -1
View File
@@ -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 }
});