From d35b2032bc055df4e896f8edede6678f4475e11a Mon Sep 17 00:00:00 2001 From: Manmeet Date: Tue, 27 Jul 2021 21:56:31 +0530 Subject: [PATCH] Typecasting Float to Integer and back to avoid floating point precision errors (#423) https://stackoverflow.com/questions/3439040/why-does-adding-two-decimals-in-javascript-produce-a-wrong-result https://stackoverflow.com/questions/1458633/how-to-deal-with-floating-point-number-precision-in-javascript Co-authored-by: xrimpy <=> --- frontend/src/Editor/Editor.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index 44edc5df16..838f70f468 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -433,8 +433,8 @@ class Editor extends React.Component { this.setState({ showQuerySearchField: !this.state.showQuerySearchField }); } - onVersionDeploy = (versionId) => { - this.setState({ app: { + onVersionDeploy = (versionId) => { + this.setState({ app: { ...this.state.app, current_version_id: versionId }}) @@ -535,7 +535,7 @@ class Editor extends React.Component {