Skip to content

Commit

Permalink
feat: clear result on numpad press when lastKey=EQUALS and lastOperat…
Browse files Browse the repository at this point in the history
…ion=""

This results in the user being able to type a new calculation
immediately after getting the result of the last calculation instead of
just adding more digits to the end of the result.
  • Loading branch information
JarrColl committed Jan 28, 2025
1 parent fc8e029 commit 7dbe9bc
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ class CalculatorImpl(
}

if (lastKey == EQUALS) {
if (lastOperation != "") {
handleReset()
}
lastOperation = EQUALS
}

Expand Down

0 comments on commit 7dbe9bc

Please sign in to comment.