Skip to content

Commit

Permalink
fix pendulum example to not crash on empty mass input field
Browse files Browse the repository at this point in the history
  • Loading branch information
latekvo committed Aug 5, 2024
1 parent 53866b1 commit 21967b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/common-app/src/examples/PendulumExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ export default function SpringExample() {
{
fontSize: useConfigWithDuration
? 50
: Math.min(0.75 * Number.parseFloat(mass), 40) + 10,
: Math.min(
0.75 * Number.parseFloat(mass === '' ? '0' : mass),
40
) + 10,
},
]}>
{/* Using here view with border radius would be more natural, but views with border radius and rotation are bugged on android */}
Expand Down

0 comments on commit 21967b1

Please sign in to comment.