0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-25 18:22:42 +00:00

Rewrite path oncomponant load for cloned brews to prevent losing active changes on the "new" document.

This commit is contained in:
David Bolack
2024-08-19 20:35:23 -05:00
parent 31fcf28e3f
commit 67e868b5ee

View File

@@ -84,6 +84,9 @@ const NewPage = createClass({
if(brew.style)
localStorage.setItem(STYLEKEY, brew.style);
localStorage.setItem(METAKEY, JSON.stringify({ 'renderer': brew.renderer, 'theme': brew.theme, 'lang': brew.lang }));
if(window.location.pathname != '/new') {
window.location.pathname = '/new';
}
},
componentWillUnmount : function() {
document.removeEventListener('keydown', this.handleControlKeys);