mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 20:42:43 +00:00
Small rearrangement
This commit is contained in:
@@ -264,7 +264,7 @@ const EditPage = createClass({
|
|||||||
this.savedBrew.text = this.savedBrew.text.normalize();
|
this.savedBrew.text = this.savedBrew.text.normalize();
|
||||||
brew.pageCount = ((brew.renderer=='legacy' ? brew.text.match(/\\page/g) : brew.text.match(/^\\page$/gm)) || []).length + 1;
|
brew.pageCount = ((brew.renderer=='legacy' ? brew.text.match(/\\page/g) : brew.text.match(/^\\page$/gm)) || []).length + 1;
|
||||||
brew.patches = stringifyPatches(makePatches(this.savedBrew.text, brew.text));
|
brew.patches = stringifyPatches(makePatches(this.savedBrew.text, brew.text));
|
||||||
brew.hash = await md5(this.savedBrew.text.normalize());
|
brew.hash = await md5(this.savedBrew.text);
|
||||||
brew.text = undefined;
|
brew.text = undefined;
|
||||||
brew.textBin = undefined;
|
brew.textBin = undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -339,9 +339,9 @@ const api = {
|
|||||||
// Initialize brew from request and body, destructure query params, and set the initial value for the after-save method
|
// Initialize brew from request and body, destructure query params, and set the initial value for the after-save method
|
||||||
const brewFromClient = api.excludePropsFromUpdate(req.body);
|
const brewFromClient = api.excludePropsFromUpdate(req.body);
|
||||||
const brewFromServer = req.brew;
|
const brewFromServer = req.brew;
|
||||||
brewFromServer.text = brewFromServer.text.normalize();
|
|
||||||
splitTextStyleAndMetadata(brewFromServer);
|
splitTextStyleAndMetadata(brewFromServer);
|
||||||
|
|
||||||
|
brewFromServer.text = brewFromServer.text.normalize();
|
||||||
brewFromServer.hash = await md5(brewFromServer.text);
|
brewFromServer.hash = await md5(brewFromServer.text);
|
||||||
|
|
||||||
if((brewFromServer?.version !== brewFromClient?.version) || (brewFromServer?.hash !== brewFromClient?.hash)) {
|
if((brewFromServer?.version !== brewFromClient?.version) || (brewFromServer?.hash !== brewFromClient?.hash)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user