精简M3D Builder中收集源数据的代码。

This commit is contained in:
徐涛 2025-03-30 22:10:05 +08:00
parent 5f3d58f0f5
commit a1f63cd724

View File

@ -99,15 +99,13 @@ export function M3DynamicSchemeBuilder({ scheme, onBuildCompleted }: M3DynamicSc
(_state, formData) => {
const errMsg = new Map<string, string>();
const sourceColor = formData.get('source') as string;
if (isNil(sourceColor) || isEmpty(sourceColor)) {
const collectedSource = collectSchemeSource(formData);
if (isNil(collectedSource.source) || isEmpty(collectedSource.source)) {
errMsg.set('source', 'Source color is required');
}
if (!isEmpty(errMsg)) return errMsg;
try {
const collectedSource = collectSchemeSource(formData);
const generate_scheme = colorFn.generate_material_design_3_dynamic_scheme(
collectedSource.source,
collectedSource.error,