fix(custom-widgets): fix v2 editor crash and definition-not-found race (#6377)
This commit is contained in:
1 parent
f0963405ca
commit
3a1245cbc5
8 files changed
+194
-21
No files matched your search
@@ -253,6 +253,12 @@ export function buildDisplayConfigFromFormValues(values: CustomWidgetDisplayForm
|
||||
}
|
||||
|
||||
function parseRequestManifest(value: string) {
|
||||
const parsed: unknown = JSON.parse(value);
|
||||
return customJsxRequestSchema.array().parse(parsed);
|
||||
let parsed: unknown;
|
||||
try {
|
||||
parsed = JSON.parse(value);
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
const result = customJsxRequestSchema.array().safeParse(parsed);
|
||||
return result.success ? result.data : [];
|
||||
}
|
||||
Reference in new issue
Block a user