mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 04:27:04 +00:00
chore: only dev env can throw errors (#2355)
This commit is contained in:
parent
23cd6bb4ed
commit
c743d66b8e
@ -68,8 +68,11 @@ function Label() {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!systemSettings) {
|
||||
error('Please check if provide `SystemSettingsProvider` in your app.');
|
||||
if (process.env.NODE_ENV !== 'production' && !currentUser) {
|
||||
throw new Error('Please check if provide `CurrentUserProvider` in your app.');
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== 'production' && !systemSettings) {
|
||||
throw new Error('Please check if provide `SystemSettingsProvider` in your app.');
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { isString } from '@nocobase/utils';
|
||||
import { theme } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import { ThemeItem } from '../../types';
|
||||
@ -9,12 +8,12 @@ import { ThemeItem } from '../../types';
|
||||
*/
|
||||
export function changeAlgorithmFromStringToFunction(themeConfig: ThemeItem) {
|
||||
themeConfig = _.cloneDeep(themeConfig);
|
||||
if (isString(themeConfig.config.algorithm)) {
|
||||
if (_.isString(themeConfig.config.algorithm)) {
|
||||
themeConfig.config.algorithm = theme[themeConfig.config.algorithm];
|
||||
}
|
||||
if (Array.isArray(themeConfig.config.algorithm)) {
|
||||
themeConfig.config.algorithm = themeConfig.config.algorithm.map((item) => {
|
||||
if (isString(item)) {
|
||||
if (_.isString(item)) {
|
||||
return theme[item];
|
||||
}
|
||||
return item;
|
||||
|
@ -1,9 +1,8 @@
|
||||
import { Collection } from '@nocobase/database';
|
||||
import { InstallOptions, Plugin } from '@nocobase/server';
|
||||
import { antd, compact, compactDark, dark } from './builtinThemes';
|
||||
|
||||
export class ThemeEditorPlugin extends Plugin {
|
||||
theme: Collection<any, any>;
|
||||
theme: any;
|
||||
|
||||
afterAdd() {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user