Skip to content

Commit

Permalink
Merge pull request #310 from mini-bomba/redeem_with_enter
Browse files Browse the repository at this point in the history
Make the enter key on the license key box redeem
  • Loading branch information
ajayyy authored Nov 20, 2024
2 parents d929b87 + e75b52e commit 3d19f3a
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 3d19f3a

Please sign in to comment.