Skip to content

Commit

Permalink
fix: remove the locale menu when menu is set to false
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Aug 6, 2024
1 parent c844080 commit 571246b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/layout/SpaceContainer/Sider/MineItem/Locale.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ const Locale: React.FC<IProps> = function () {
const localeObj =
localeList.find((item) => item.value.toLowerCase() === locale?.toLowerCase()) ||
localeList.find((item) => item.value?.toLowerCase() === defaultLocale?.toLowerCase());
if (!odc.appConfig.locale.menu) {
return null;
}
return (
<DropMenu
small
Expand Down
12 changes: 8 additions & 4 deletions src/layout/SpaceContainer/Sider/MineItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import styles from './index.less';
import tracert from '@/util/tracert';
import { ItemType } from 'antd/es/menu/hooks/useItems';
import Locale from './Locale';
import odc from '@/plugins/odc';

interface IProps {
userStore?: UserStore;
Expand Down Expand Up @@ -132,10 +133,13 @@ const MineItem: React.FC<IProps> = function ({ children, userStore, settingStore
},
});
}
menu.push({
label: <Locale />,
key: 'locale',
});
if (odc.appConfig.locale.menu) {
menu.push({
label: <Locale />,
key: 'locale',
});
}

if (settingStore.enablePersonalRecord) {
menu.push({
key: 'record',
Expand Down

0 comments on commit 571246b

Please sign in to comment.