Skip to content

Commit

Permalink
chore: optimze LGTM (#35443)
Browse files Browse the repository at this point in the history
* chore: optimze LGTM

* chore: type
  • Loading branch information
MadCcc committed May 9, 2022
1 parent 01ebb6a commit b5699cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion site/theme/template/Layout/Header/More.tsx
Expand Up @@ -7,7 +7,7 @@ import type { SharedProps } from './interface';

const smallStyle = { fontSize: 12, color: '#777', marginLeft: '0.3em' };

export function getEcosystemGroup(): MenuProps['items'] {
export function getEcosystemGroup(): Exclude<MenuProps['items'], undefined> {
return [
{
label: (
Expand Down
6 changes: 3 additions & 3 deletions site/theme/template/Layout/Header/Navigation.tsx
Expand Up @@ -69,7 +69,7 @@ export default ({
onClick: onDirectionChange,
key: 'switch-direction',
},
...(getEcosystemGroup() ?? []),
...getEcosystemGroup(),
];

if (isMobile) {
Expand Down Expand Up @@ -129,8 +129,8 @@ export default ({
: null,
isZhCN &&
typeof window !== 'undefined' &&
!window.location.href.includes('ant-design.antgroup.com') &&
!window.location.href.includes('ant-design.gitee.io')
!window.location.host.includes('ant-design.antgroup.com') &&
!window.location.host.includes('ant-design.gitee.io')
? {
label: '国内镜像',
key: 'mirror',
Expand Down
2 changes: 1 addition & 1 deletion site/theme/template/Layout/Header/index.tsx
Expand Up @@ -121,7 +121,7 @@ class Header extends React.Component<HeaderProps, HeaderState> {
});
if (
process.env.NODE_ENV === 'production' &&
!window.location.href.includes('ant-design.antgroup.com') &&
!window.location.host.includes('ant-design.antgroup.com') &&
shouldOpenAntdMirrorModal()
) {
Modal.confirm({
Expand Down

0 comments on commit b5699cc

Please sign in to comment.