Skip to content

Commit

Permalink
fix(ui): Handle more empty text inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Jan 31, 2023
1 parent a2ec36f commit bc03770
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/userscript/source/ui/components/UiComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export abstract class UiComponent extends EventTarget {

static promptPercentage(text: string, defaultValue: string): number | null {
const value = window.prompt(text, defaultValue);
if (value === null) {
if (value === null || value === "") {
return null;
}

Expand All @@ -111,7 +111,7 @@ export abstract class UiComponent extends EventTarget {

static promptFloat(text: string, defaultValue: string): number | null {
const value = window.prompt(text, defaultValue);
if (value === null) {
if (value === null || value === "") {
return null;
}

Expand Down

0 comments on commit bc03770

Please sign in to comment.