Skip to content

Commit

Permalink
fix(cf): error message does not disappear after update the icon set c…
Browse files Browse the repository at this point in the history
…onfiguration(#480)
  • Loading branch information
Gggpound committed Mar 26, 2024
1 parent d285526 commit f17cbf4
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,21 +335,6 @@ export const IconSet = (props: IStyleEditorProps<unknown, IIconSet>) => {
);
}, [configList]);

const handleClickIconList = (iconType: IIconType) => {
currentIconTypeSet(iconType);
const list = iconMap[iconType] || [];
const config = new Array(list.length).fill('').map((_e, index, list) => createDefaultConfigItem(iconType, index, list));
configListSet(config);
};

const handleChange = (keys: string[], v: unknown) => {
const oldV = get(configList, keys);
if (oldV !== v) {
set(configList, keys, v);
configListSet([...configList]);
errorMapSet(checkResult(configList));
}
};
const checkResult = (_configList: typeof configList) => {
const isTypeSame = _configList.reduce((pre, cur, index) => {
if ((pre.preType && !pre.result) || _configList.length - 1 === index) {
Expand Down Expand Up @@ -391,6 +376,21 @@ export const IconSet = (props: IStyleEditorProps<unknown, IIconSet>) => {
}
return {};
};
const handleChange = (keys: string[], v: unknown) => {
const oldV = get(configList, keys);
if (oldV !== v) {
set(configList, keys, v);
configListSet([...configList]);
errorMapSet(checkResult(configList));
}
};
const handleClickIconList = (iconType: IIconType) => {
currentIconTypeSet(iconType);
const list = iconMap[iconType] || [];
const config = new Array(list.length).fill('').map((_e, index, list) => createDefaultConfigItem(iconType, index, list));
configListSet(config);
errorMapSet(checkResult(config));
};

useEffect(() => {
const dispose = interceptorManager.intercept(interceptorManager.getInterceptPoints().submit, { handler() {
Expand Down

0 comments on commit f17cbf4

Please sign in to comment.