Skip to content

Commit 149e6f8

Browse files
authored
Merge pull request #344 from guanweiwang/main
fix: work_mode 不匹配问题
2 parents 2d8e72f + 09e9383 commit 149e6f8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ui/src/pages/chat/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,13 @@ const Chat = () => {
137137
color: 'info',
138138
},
139139
};
140-
return (
141-
<StyledLabel color={value ? workModeMap[value]['color'] : 'default'}>
142-
{value ? workModeMap[value]['name'] : '未知'}
143-
</StyledLabel>
144-
);
140+
141+
const current = workModeMap[value!] || {
142+
color: 'default',
143+
name: '未知',
144+
};
145+
146+
return <StyledLabel color={current.color}>{current.name}</StyledLabel>;
145147
},
146148
},
147149
{

0 commit comments

Comments
 (0)