From 3120087992cd5057829c82869f58e9fcb7b87885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=80=E7=B1=B3?= <76780744+YBY2020@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:00:03 +0800 Subject: [PATCH] =?UTF-8?q?perf=20:=20=E4=BB=A3=E7=A0=81=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 大神, 学习代码过程中发现的一个小小的点,887行已定义`const isUser = message.role === "user";`,此处可直接用isUser --- app/components/chat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 25c3be26ed5..ff0bc5b347d 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -922,7 +922,7 @@ export function Chat() { }} > - {message.role === "user" ? ( + {isUser ? ( ) : (