Skip to content

Commit

Permalink
fix remove toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielrz committed Jan 5, 2024
1 parent 05688a0 commit e424d33
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ function App() {
const answer = Math.round(eval(input) * 1e12) / (1e12).toString();
setInput(answer);
setResult(answer);
const divide = document.getElementById("divide");
const times = document.getElementById("times");
const subtract = document.getElementById("subtract");
const plus = document.getElementById("plus");
divide.classList.remove("toggled");
times.classList.remove("toggled");
subtract.classList.remove("toggled");
plus.classList.remove("toggled");
} catch (error) {
setInput("Error");
setResult("Error");
Expand Down Expand Up @@ -175,6 +167,10 @@ function App() {
) {
setInput(`${input}${value}`);
setResult(`${value}`);
divide.classList.remove("toggled");
times.classList.remove("toggled");
subtract.classList.remove("toggled");
plus.classList.remove("toggled");
} else {
if (input.startsWith(0)) {
setInput(`${value}`);
Expand Down

0 comments on commit e424d33

Please sign in to comment.