Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lapis256 committed Apr 29, 2022
1 parent a47e256 commit 62f9d38
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions behavior/scripts/src/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ export async function InputSingleText(
placeholderText,
defaultValue
) {
const {
isCanceled,
formValues: [text],
} = await new ModalFormData()
const { isCanceled, formValues } = await new ModalFormData()
.title(title)
.textField(label, placeholderText, defaultValue)
.show(player);

if (isCanceled) return;

if (text === "") {
if (formValues[0] === "") {
return await InputSingleText(
player,
title,
Expand All @@ -36,5 +33,5 @@ export async function InputSingleText(
defaultValue
);
}
return text;
return formValues[0];
}

0 comments on commit 62f9d38

Please sign in to comment.