0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-17 01:32:45 +00:00

Merge pull request #1416 from G-Ambatte/fixGoogleBrews_v2_13

Attempt to fix issue with saving Google brews.
This commit is contained in:
Trevor Buckner
2021-06-28 12:10:43 -04:00
committed by GitHub

View File

@@ -135,7 +135,7 @@ const NewPage = createClass({
console.log('saving new brew'); console.log('saving new brew');
const brew = this.state.brew; let brew = this.state.brew;
// Split out CSS to Style if CSS codefence exists // Split out CSS to Style if CSS codefence exists
if(brew.text.startsWith('```css') && brew.text.indexOf('```\n\n') > 0) { if(brew.text.startsWith('```css') && brew.text.indexOf('```\n\n') > 0) {
const index = brew.text.indexOf('```\n\n'); const index = brew.text.indexOf('```\n\n');
@@ -155,7 +155,7 @@ const NewPage = createClass({
return; return;
}); });
const brew = res.body; brew = res.body;
localStorage.removeItem(BREWKEY); localStorage.removeItem(BREWKEY);
localStorage.removeItem(STYLEKEY); localStorage.removeItem(STYLEKEY);
window.location = `/edit/${brew.googleId}${brew.editId}`; window.location = `/edit/${brew.googleId}${brew.editId}`;
@@ -170,7 +170,7 @@ const NewPage = createClass({
return; return;
} }
window.onbeforeunload = function(){}; window.onbeforeunload = function(){};
const brew = res.body; brew = res.body;
localStorage.removeItem(BREWKEY); localStorage.removeItem(BREWKEY);
localStorage.removeItem(STYLEKEY); localStorage.removeItem(STYLEKEY);
window.location = `/edit/${brew.editId}`; window.location = `/edit/${brew.editId}`;