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

Use same brew object throughout

Rather than using separate `brewText` and `styleText` state variables when printing from /new, just load the files into the same `brew` object the rest of the page uses.

Also load localstorage in the same way as on `/new` via BREWKEY and STYLEKEY for consistency, rather than passing it in as a separate `brew` item in localstorage
This commit is contained in:
Trevor Buckner
2021-10-07 22:01:53 -04:00
parent 213a469dd0
commit 1f4ffa6785
2 changed files with 27 additions and 17 deletions

View File

@@ -274,7 +274,6 @@ const NewPage = createClass({
},
print : function(){
localStorage.setItem('print', `<style>\n${this.state.brew.style}\n</style>\n\n${this.state.brew.text}`);
window.open('/print?dialog=true&local=print', '_blank');
},