mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(frontend): Fix checking of Date and NaN input values (#10781)
Date values were being rejected as "empty" by the run input form.  ### Changes 🏗️ - Specifically handle `Date` type values in `isEmpty` - Specifically handle `NaN` values in `isEmpty` ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Date values are no longer rejected as "empty"
This commit is contained in:
committed by
GitHub
parent
b23cb14e49
commit
b333d56492
@@ -395,7 +395,9 @@ export function isEmpty(value: any): boolean {
|
||||
return (
|
||||
value === undefined ||
|
||||
value === "" ||
|
||||
(typeof value === "object" && _isEmpty(value))
|
||||
(typeof value === "object" &&
|
||||
(value instanceof Date ? isNaN(value.getTime()) : _isEmpty(value))) ||
|
||||
(typeof value === "number" && isNaN(value))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user