精简M3D Builder中收集源数据的代码。
This commit is contained in:
parent
5f3d58f0f5
commit
a1f63cd724
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user