diff --git a/src/frontend/components/RenderChat/index.tsx b/src/frontend/components/RenderChat/index.tsx index 0c9faaf..9d8dd80 100644 --- a/src/frontend/components/RenderChat/index.tsx +++ b/src/frontend/components/RenderChat/index.tsx @@ -7,8 +7,6 @@ import { useActiveChatId, useGetChat } from 'src/frontend/hooks'; import type { conversationMessage } from 'src/frontend/types'; import { Style } from './style'; - - export function RenderChat() { const { activeChatId } = useActiveChatId(); const { chat, status } = useGetChat(activeChatId); @@ -19,14 +17,12 @@ export function RenderChat() { let id = 0; return ( <> - {/* biome-ignore lint/suspicious/noExplicitAny: */} {chat?.conversation.map((item: conversationMessage) => { const { type, message } = item; - let AIResponse = "" - if(type === 'AI') { - const entries = Object.entries(message) - if(entries.length > 0) - AIResponse = entries[0][1]; + let AIResponse = ''; + if (type === 'AI') { + const entries = Object.entries(message); + if (entries.length > 0) AIResponse = entries[0][1]; } return ( - {type === 'AI' ? AIResponse : message as string} + {type === 'AI' ? AIResponse : (message as string)} ); })} diff --git a/src/frontend/components/RenderChat/style.ts b/src/frontend/components/RenderChat/style.ts index 0aba4c9..9988eda 100644 --- a/src/frontend/components/RenderChat/style.ts +++ b/src/frontend/components/RenderChat/style.ts @@ -1,4 +1,4 @@ -import { StyleSheet } from "react-native"; +import { StyleSheet } from 'react-native'; export const Style = StyleSheet.create({ bubble: { @@ -8,4 +8,4 @@ export const Style = StyleSheet.create({ display: 'flex', flexDirection: 'column' } -}) \ No newline at end of file +}); diff --git a/src/frontend/screens/ChatUI/index.tsx b/src/frontend/screens/ChatUI/index.tsx index e7635ca..2fcef24 100644 --- a/src/frontend/screens/ChatUI/index.tsx +++ b/src/frontend/screens/ChatUI/index.tsx @@ -117,7 +117,7 @@ export function ChatUI() { model: ['gpt-4'], conversation: [] }); - const id = result?.id + const id = result?.id; setActiveChatId(id || ''); }; if (activeChatId === 'default') create();