mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: fix empty pretest input
This commit is contained in:
1 parent
f30a39593f
commit
478666bdf5
2 files changed
+3
-3
No files matched your search
@@ -51,9 +51,9 @@ export interface Types {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const basicString = <T = string>(regex?: RegExp, cb?: (i: string) => boolean, convert?: (i: string) => T) => [
|
const basicString = <T = string>(regex?: RegExp, cb?: (i: string) => boolean, convert?: (i: string) => T) => [
|
||||||
convert || ((v) => v.toString().trim()),
|
convert || ((v) => v.toString()),
|
||||||
(v) => {
|
(v) => {
|
||||||
const res = v.toString().trim();
|
const res = v.toString();
|
||||||
if (regex && !regex.test(res)) return false;
|
if (regex && !regex.test(res)) return false;
|
||||||
if (cb && !cb(res)) return false;
|
if (cb && !cb(res)) return false;
|
||||||
return !!res.length;
|
return !!res.length;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
const req = request.post(UiContext.postSubmitUrl, {
|
const req = request.post(UiContext.postSubmitUrl, {
|
||||||
lang: props.editorLang,
|
lang: props.editorLang,
|
||||||
code: props.editorCode,
|
code: props.editorCode,
|
||||||
input: props.pretestInput || ' ',
|
input: props.pretestInput,
|
||||||
pretest: true,
|
pretest: true,
|
||||||
});
|
});
|
||||||
dispatch({
|
dispatch({
|
||||||
|
|||||||
Reference in new issue
Block a user