0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-06 12:12:42 +00:00

Clear data from new key when appropriate

This commit is contained in:
Sean Robertson
2021-06-21 16:27:18 +12:00
parent 0eaeb748f4
commit 09c7f45c69

View File

@@ -158,6 +158,7 @@ const NewPage = createClass({
const brew = res.body; const brew = res.body;
localStorage.removeItem(BREWKEY); localStorage.removeItem(BREWKEY);
localStorage.removeItem(STYLEKEY);
window.location = `/edit/${brew.googleId}${brew.editId}`; window.location = `/edit/${brew.googleId}${brew.editId}`;
} else { } else {
request.post('/api') request.post('/api')
@@ -172,6 +173,7 @@ const NewPage = createClass({
window.onbeforeunload = function(){}; window.onbeforeunload = function(){};
const brew = res.body; const brew = res.body;
localStorage.removeItem(BREWKEY); localStorage.removeItem(BREWKEY);
localStorage.removeItem(STYLEKEY);
window.location = `/edit/${brew.editId}`; window.location = `/edit/${brew.editId}`;
}); });
} }