fix: cannot clear color value when creating themes

This commit is contained in:
HFO4 2022-04-24 15:15:00 +08:00
parent 566900ccbb
commit 0deacc2d4d
2 changed files with 9 additions and 2 deletions

View File

@ -52,7 +52,11 @@ export default function CreateTheme({ open, onClose, onSubmit }) {
});
const subTheme = useCallback(() => {
return createMuiTheme(theme);
try {
return createMuiTheme(theme);
} catch (e) {
return createMuiTheme({});
}
}, [theme]);
return (

View File

@ -483,7 +483,10 @@ export const selectFile = (file: any, event: any, fileIndex: any) => {
const { ctrlKey, metaKey, shiftKey } = event;
return (dispatch: any, getState: any) => {
// 多种组合操作忽略
if ([ctrlKey, shiftKey].filter(Boolean).length > 1 || [metaKey, shiftKey].filter(Boolean).length > 1) {
if (
[ctrlKey, shiftKey].filter(Boolean).length > 1 ||
[metaKey, shiftKey].filter(Boolean).length > 1
) {
return;
}
const isMacbook = isMac();