0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-22 07:27:51 +00:00

Immediately save brew to localstorage upon page load

This commit is contained in:
Trevor Buckner
2022-08-30 22:50:04 -04:00
parent 59451f47e6
commit 17704e5010

View File

@@ -84,6 +84,11 @@ const NewPage = createClass({
},
componentDidMount : function() {
localStorage.setItem(BREWKEY, this.state.brew.text);
localStorage.setItem(STYLEKEY, this.state.brew.style);
localStorage.setItem(METAKEY, JSON.stringify({
'renderer' : this.state.brew.renderer
}));
document.addEventListener('keydown', this.handleControlKeys);
},
componentWillUnmount : function() {