Skip to content

Commit

Permalink
Make the enter key on the license key box redeem
Browse files Browse the repository at this point in the history
  • Loading branch information
mini-bomba committed Nov 20, 2024
1 parent cb73464 commit e75b52e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/help/PaymentComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ export const PaymentComponent = () => {
placeholder="Enter license key"
onChange={(e) => {
setRedeemEnabled(e.target.value.length > 0);
}}
onKeyDown={(e) => {
if (e.key != "Enter") return;
if (!redeemEnabled) return;
applyChoices({
licenseKey: (document.getElementById("redeemCodeInput") as HTMLInputElement).value
})
}}/>

<a
Expand Down Expand Up @@ -263,4 +270,4 @@ async function shouldAllowLicenseKey(licenseKey: string): Promise<boolean> {
} catch (e) { } // eslint-disable-line no-empty

return true;
}
}

0 comments on commit e75b52e

Please sign in to comment.