mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-17 10:12:40 +00:00
Immediately save brew to localstorage upon page load
This commit is contained in:
@@ -84,6 +84,11 @@ const NewPage = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount : function() {
|
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);
|
document.addEventListener('keydown', this.handleControlKeys);
|
||||||
},
|
},
|
||||||
componentWillUnmount : function() {
|
componentWillUnmount : function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user