mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +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) => [
|
||||
convert || ((v) => v.toString().trim()),
|
||||
convert || ((v) => v.toString()),
|
||||
(v) => {
|
||||
const res = v.toString().trim();
|
||||
const res = v.toString();
|
||||
if (regex && !regex.test(res)) return false;
|
||||
if (cb && !cb(res)) return false;
|
||||
return !!res.length;
|
||||
|
||||
@@ -40,7 +40,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
const req = request.post(UiContext.postSubmitUrl, {
|
||||
lang: props.editorLang,
|
||||
code: props.editorCode,
|
||||
input: props.pretestInput || ' ',
|
||||
input: props.pretestInput,
|
||||
pretest: true,
|
||||
});
|
||||
dispatch({
|
||||
|
||||
Reference in new issue
Block a user