Skip to content

Commit

Permalink
fix:_AppThemePack Error
Browse files Browse the repository at this point in the history
  • Loading branch information
shanhexi committed Mar 21, 2024
1 parent c8f54da commit 93ead92
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion chat2db-client/src/blocks/Tree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ const TreeNode = memo((props: TreeNodeIProps) => {
zIndex: 1080,
}}
>
<Tooltip placement="right" color={window._AppThemePack.colorPrimary} title={treeNodeData.comment}>
<Tooltip placement="right" color={window._AppThemePack?.colorPrimary} title={treeNodeData.comment}>
<div
className={classnames(styles.treeNode, { [styles.treeNodeFocus]: isFocus })}
onClick={handelClickTreeNode}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function useMonacoTheme() {
const [appTheme] = useTheme();
// 监听主题色变化切换编辑器主题色
useEffect(() => {
const { colorPrimary, colorBgBase, colorTextBase } = window._AppThemePack;
const { colorPrimary, colorBgBase, colorTextBase } = window._AppThemePack || {};

const colors = {
'editor.lineHighlightBackground': colorPrimary + '14', // 当前行背景色
Expand Down
4 changes: 2 additions & 2 deletions chat2db-client/src/pages/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const Login: React.FC = () => {
<div className={styles.loginWelcome}>{i18n('login.text.welcome')}</div>
<Tooltip
placement="right"
color={window._AppThemePack.colorBgBase}
color={window._AppThemePack?.colorBgBase}
title={
<div style={{ color: window._AppThemePack.colorText, opacity: 0.8, padding: '8px 4px' }}>
<div style={{ color: window._AppThemePack?.colorText, opacity: 0.8, padding: '8px 4px' }}>
{i18n('login.text.tips')}
</div>
}
Expand Down

0 comments on commit 93ead92

Please sign in to comment.