From 004ec5b04cd0c271a734b99db50ad722405b6898 Mon Sep 17 00:00:00 2001 From: tonyjleal Date: Fri, 14 Jan 2022 12:59:46 +0100 Subject: [PATCH] Fix Bug: When you pressed 0, next value shouldn't concatenate with this --- src/logic/calculate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logic/calculate.js b/src/logic/calculate.js index 97e653205..6e44fb1fa 100644 --- a/src/logic/calculate.js +++ b/src/logic/calculate.js @@ -27,7 +27,7 @@ export default function calculate(obj, buttonName) { } // If there is an operation, update next if (obj.operation) { - if (obj.next) { + if (obj.next && obj.next !== "0") { return { next: obj.next + buttonName }; } return { next: buttonName };