Skip to content

Commit

Permalink
fix: add selectTab empty case
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Nov 27, 2024
1 parent b235a8c commit 5b92522
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/page/Workspace/SideBar/components/SideTabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function SideTabs(props: IProps) {
);
})}
</Space>
<Action.Group size={selectTab.groupSize}>
<Action.Group size={selectTab?.groupSize}>
{selectTab?.actions?.map((action) => {
if ('render' in action) {
return action.render();
Expand All @@ -100,12 +100,12 @@ export default function SideTabs(props: IProps) {
<div className={styles.content}>
{tabs
.map((tab) => {
if (loadedKeys.current.has(tab.key) || selectTab.key === tab.key) {
if (loadedKeys.current.has(tab.key) || selectTab?.key === tab.key) {
return (
<div
key={tab.key}
className={styles.component}
style={{ zIndex: selectTab.key === tab.key ? 'unset' : -9999 }}
style={{ zIndex: selectTab?.key === tab.key ? 'unset' : -9999 }}
>
{tab?.render?.()}
</div>
Expand Down

0 comments on commit 5b92522

Please sign in to comment.