From 77973f003708dff047bf37babb5d7afc400b2cd2 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 12 Oct 2020 14:30:42 -0400 Subject: [PATCH] v2.10.1 - Fix brews lost on back button --- changelog.md | 19 ++++++++++++------- client/homebrew/pages/editPage/editPage.jsx | 2 +- package-lock.json | 2 +- package.json | 2 +- server.js | 1 + 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/changelog.md b/changelog.md index a1d95b955..7b2d7e33b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # changelog +### Monday, 12/10/2020 - v2.10.1 +- Fixed issue with users unable to create new brews +- Fixing brews being lost when loaded via back button + ### Wednesday, 07/10/2020 - v2.10.0 - Google Drive integration -- Sign in with your Google account to link it with your Homebrewery profile. A new button in the Edit page will let you transfer your file to your personal Google Drive storage, and Google will keep a backup of each version! No more lost work surprises! @@ -40,11 +44,13 @@ ### Saturday, 22/04/2017 - v2.7.4 - Give ability to hide the render warning notification +``` +``` + ### Friday, 03/03/2017 - v2.7.3 - Increasing the range on the Partial Page Rendering for a quick-fix for it getting out of sync on long brews. -``` -``` + ### Saturday, 18/02/2017 - v2.7.2 - Adding ability to delete a brew from the user page, incase the user creates a brew that makes the edit page unrender-able. (re:309) @@ -82,12 +88,11 @@ - Added a table of contents snippet (thanks u/tullisar) - Added a multicolumn snippet +\page ### Thursday, 01/12/2016 - Added in a snippet for a split table - Added an account nav item to new page -\page - ### Sunday, 27/11/2016 - v2.5.1 - Fixed the column rendering on the new user page. Really should have tested that better - Added a hover tooltip to fully read the brew description @@ -127,12 +132,12 @@ - Fixed the noteblock overlapping into titles (thanks u/dsompura!) - Fixed a bad search route in the admin panel (thanks u/SnappyTom!) +``` +``` + ### Friday, 29/07/2016 - v2.2.7 - Adding in descriptive note blocks. (Thanks calculuschild!) -``` -``` - ### Thursday, 07/07/2016 - v2.2.6 - Added a new nav item on the homepage for accessing both recently viewed and edited brews (thanks [ChosenSeraph!](https://github.com/stolksdorf/homebrewery/issues/147)) diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index 38f9eb482..e1ca95a32 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -89,7 +89,7 @@ const EditPage = createClass({ const S_KEY = 83; const P_KEY = 80; if(e.keyCode == S_KEY) this.save(); - if(e.keyCode == P_KEY) window.open(`/print/${this.props.brew.shareId}?dialog=true`, '_blank').focus(); + if(e.keyCode == P_KEY) window.open(`/print/${this.processShareId()}?dialog=true`, '_blank').focus(); if(e.keyCode == P_KEY || e.keyCode == S_KEY){ e.stopPropagation(); e.preventDefault(); diff --git a/package-lock.json b/package-lock.json index d229c8c55..9153be6a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "homebrewery", - "version": "2.10.0", + "version": "2.10.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f5f060b8a..f2e588d3b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "homebrewery", "description": "Create authentic looking D&D homebrews using only markdown", - "version": "2.10.0", + "version": "2.10.1", "engines": { "node": "12.16.x" }, diff --git a/server.js b/server.js index 0f83c23f6..a268a3219 100644 --- a/server.js +++ b/server.js @@ -117,6 +117,7 @@ app.get('/user/:username', async (req, res, next)=>{ //Edit Page app.get('/edit/:id', (req, res, next)=>{ + res.header('Cache-Control', 'no-cache, no-store'); //reload the latest saved brew when pressing back button, not the cached version before save. if(req.params.id.length > 12) { const googleId = req.params.id.slice(0, -12); const editId = req.params.id.slice(-12);