Skip to content

Commit

Permalink
Website: set command argument to undefined if not required (#42)
Browse files Browse the repository at this point in the history
* set command argument to undefined if not required

* fix prettier warning
  • Loading branch information
beesaferoot authored Nov 18, 2024
1 parent 285b948 commit 526510f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions website/src/app/Components/HomeComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const HomeComponent: React.FC = () => {
const [startingCode, setStartingCode] = useState<number | null>(null)
const [privateKey, setPrivateKey] = useState<string>("")
const [selectedCommand, setSelectedCommand] = useState<string>("1")
const [commandArgument, setCommandArgument] = useState<number>()
const [commandArgument, setCommandArgument] = useState<number | undefined>(
undefined
)
const [result, setResult] = useState<TokenData | null>(null)
const [error, setError] = useState<string | null>(null)

Expand Down Expand Up @@ -182,7 +184,7 @@ const HomeComponent: React.FC = () => {
const newCommand = e.target.value
setSelectedCommand(newCommand)
if (!commandOptions[newCommand].requiresArgument) {
setCommandArgument(0)
setCommandArgument(undefined)
}
}}
required
Expand Down

0 comments on commit 526510f

Please sign in to comment.