Browse Source

perf : 代码细节优化

大神, 学习代码过程中发现的一个小小的点,887行已定义`const isUser = message.role === "user";`,此处可直接用isUser
兀米 1 year ago
parent
commit
3120087992
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/components/chat.tsx

+ 1 - 1
app/components/chat.tsx

@@ -922,7 +922,7 @@ export function Chat() {
                         }}
                       ></IconButton>
                     </div>
-                    {message.role === "user" ? (
+                    {isUser ? (
                       <Avatar avatar={config.avatar} />
                     ) : (
                       <MaskAvatar mask={session.mask} />