Skip to content

Commit 93ead92

Browse files
committed
fix:_AppThemePack Error
1 parent c8f54da commit 93ead92

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

chat2db-client/src/blocks/Tree/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ const TreeNode = memo((props: TreeNodeIProps) => {
394394
zIndex: 1080,
395395
}}
396396
>
397-
<Tooltip placement="right" color={window._AppThemePack.colorPrimary} title={treeNodeData.comment}>
397+
<Tooltip placement="right" color={window._AppThemePack?.colorPrimary} title={treeNodeData.comment}>
398398
<div
399399
className={classnames(styles.treeNode, { [styles.treeNodeFocus]: isFocus })}
400400
onClick={handelClickTreeNode}

chat2db-client/src/components/MonacoEditor/useMonacoTheme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function useMonacoTheme() {
88
const [appTheme] = useTheme();
99
// 监听主题色变化切换编辑器主题色
1010
useEffect(() => {
11-
const { colorPrimary, colorBgBase, colorTextBase } = window._AppThemePack;
11+
const { colorPrimary, colorBgBase, colorTextBase } = window._AppThemePack || {};
1212

1313
const colors = {
1414
'editor.lineHighlightBackground': colorPrimary + '14', // 当前行背景色

chat2db-client/src/pages/login/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ const Login: React.FC = () => {
3838
<div className={styles.loginWelcome}>{i18n('login.text.welcome')}</div>
3939
<Tooltip
4040
placement="right"
41-
color={window._AppThemePack.colorBgBase}
41+
color={window._AppThemePack?.colorBgBase}
4242
title={
43-
<div style={{ color: window._AppThemePack.colorText, opacity: 0.8, padding: '8px 4px' }}>
43+
<div style={{ color: window._AppThemePack?.colorText, opacity: 0.8, padding: '8px 4px' }}>
4444
{i18n('login.text.tips')}
4545
</div>
4646
}

0 commit comments

Comments
 (0)