Skip to content

Commit

Permalink
fix: lint & format
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Varga <lukas.varga128@gmail.com>
Signed-off-by: eloinoel <eloi.sandt.games@gmx.de>
  • Loading branch information
eloinoel and lukas-varga committed Jul 12, 2024
1 parent ad8c032 commit f76fb80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
14 changes: 5 additions & 9 deletions src/frontend/components/RenderChat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -19,14 +17,12 @@ export function RenderChat() {
let id = 0;
return (
<>
{/* biome-ignore lint/suspicious/noExplicitAny: <explanation> */}
{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 (
<View
Expand All @@ -43,7 +39,7 @@ export function RenderChat() {
{type === 'AI' ? 'AiLixir' : user?.displayName || 'User'}
</Text>
</View>
<Markdown>{type === 'AI' ? AIResponse : message as string}</Markdown>
<Markdown>{type === 'AI' ? AIResponse : (message as string)}</Markdown>
</View>
);
})}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/components/RenderChat/style.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StyleSheet } from "react-native";
import { StyleSheet } from 'react-native';

export const Style = StyleSheet.create({
bubble: {
Expand All @@ -8,4 +8,4 @@ export const Style = StyleSheet.create({
display: 'flex',
flexDirection: 'column'
}
})
});
2 changes: 1 addition & 1 deletion src/frontend/screens/ChatUI/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f76fb80

Please sign in to comment.