Skip to content

Commit

Permalink
fix(client): validate input response in aiscript
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Feb 5, 2023
1 parent d65e5f6 commit 5f3640c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
6 changes: 5 additions & 1 deletion packages/frontend/src/pages/flash/flash.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ async function run() {
os.inputText({
title: q,
}).then(({ canceled, result: a }) => {
ok(a);
if (canceled) {
ok('');
} else {
ok(a);
}
});
});
},
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/src/pages/scratchpad.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ async function run() {
os.inputText({
title: q,
}).then(({ canceled, result: a }) => {
ok(a);
if (canceled) {
ok('');
} else {
ok(a);
}
});
});
},
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ export function install(plugin) {
inputText({
title: q,
}).then(({ canceled, result: a }) => {
ok(a);
if (canceled) {
ok('');
} else {
ok(a);
}
});
});
},
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/src/widgets/WidgetAiscript.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ const run = async () => {
os.inputText({
title: q,
}).then(({ canceled, result: a }) => {
ok(a);
if (canceled) {
ok('');
} else {
ok(a);
}
});
});
},
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/src/widgets/WidgetAiscriptApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ async function run() {
os.inputText({
title: q,
}).then(({ canceled, result: a }) => {
ok(a);
if (canceled) {
ok('');
} else {
ok(a);
}
});
});
},
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/src/widgets/WidgetButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ const run = async () => {
os.inputText({
title: q,
}).then(({ canceled, result: a }) => {
ok(a);
if (canceled) {
ok('');
} else {
ok(a);
}
});
});
},
Expand Down

0 comments on commit 5f3640c

Please sign in to comment.