Skip to content

Commit 8134577

Browse files
committed
fix linting
1 parent 6a9645d commit 8134577

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

dist/components/bubbles/AgentReasoningBubble.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

src/components/Bot.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
417417
allMessages[allMessages.length - 1].artifacts = artifacts;
418418
addChatMessage(allMessages);
419419
return allMessages;
420-
})
421-
}
420+
});
421+
};
422422

423423
const updateLastMessageAction = (action: IAction) => {
424424
setMessages((data) => {
@@ -834,7 +834,7 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
834834
if (message.fileUploads) chatHistory.fileUploads = message.fileUploads;
835835
if (message.agentReasoning) chatHistory.agentReasoning = message.agentReasoning;
836836
if (message.action) chatHistory.action = message.action;
837-
if (message.artifacts) chatHistory.artifacts = message.artifacts;
837+
if (message.artifacts) chatHistory.artifacts = message.artifacts;
838838
return chatHistory;
839839
})
840840
: [{ message: props.welcomeMessage ?? defaultWelcomeMessage, type: 'apiMessage' }];

src/components/bubbles/AgentReasoningBubble.tsx

+15-15
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { cloneDeep } from 'lodash';
66
type Props = {
77
apiHost?: string;
88
chatflowid: string;
9-
chatId: string
9+
chatId: string;
1010
agentName: string;
1111
agentMessage: string;
1212
agentArtifacts?: FileUpload[];
@@ -34,19 +34,19 @@ export const AgentReasoningBubble = (props: Props) => {
3434
});
3535

3636
const agentReasoningArtifacts = (artifacts: FileUpload[]) => {
37-
const newArtifacts = cloneDeep(artifacts)
37+
const newArtifacts = cloneDeep(artifacts);
3838
for (let i = 0; i < newArtifacts.length; i++) {
39-
const artifact = newArtifacts[i]
40-
if (artifact && (artifact.type === 'png' || artifact.type === 'jpeg')) {
41-
const data = artifact.data as string
42-
newArtifacts[i].data = `${props.apiHost}/api/v1/get-upload-file?chatflowId=${props.chatflowid}&chatId=${props.chatId}&fileName=${data.replace(
43-
'FILE-STORAGE::',
44-
''
45-
)}`
46-
}
39+
const artifact = newArtifacts[i];
40+
if (artifact && (artifact.type === 'png' || artifact.type === 'jpeg')) {
41+
const data = artifact.data as string;
42+
newArtifacts[i].data = `${props.apiHost}/api/v1/get-upload-file?chatflowId=${props.chatflowid}&chatId=${props.chatId}&fileName=${data.replace(
43+
'FILE-STORAGE::',
44+
'',
45+
)}`;
46+
}
4747
}
48-
return newArtifacts
49-
}
48+
return newArtifacts;
49+
};
5050

5151
const renderArtifacts = (item: Partial<FileUpload>) => {
5252
if (item.type === 'png' || item.type === 'jpeg') {
@@ -57,10 +57,10 @@ export const AgentReasoningBubble = (props: Props) => {
5757
</div>
5858
);
5959
} else if (item.type === 'html') {
60-
const src = (item.data as string);
60+
const src = item.data as string;
6161
return (
6262
<div class="mt-2">
63-
<div innerHTML={src}></div>
63+
<div innerHTML={src} />
6464
</div>
6565
);
6666
} else {
@@ -86,7 +86,7 @@ export const AgentReasoningBubble = (props: Props) => {
8686
<div class="flex flex-row items-start flex-wrap w-full gap-2">
8787
<For each={agentReasoningArtifacts(props.agentArtifacts)}>
8888
{(item) => {
89-
return item !== null ? <>{renderArtifacts(item)}</> : null
89+
return item !== null ? <>{renderArtifacts(item)}</> : null;
9090
}}
9191
</For>
9292
</div>

src/components/bubbles/BotBubble.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export const BotBubble = (props: Props) => {
248248
if (src.startsWith('FILE-STORAGE::')) {
249249
src = `${props.apiHost}/api/v1/get-upload-file?chatflowId=${props.chatflowid}&chatId=${props.chatId}&fileName=${src.replace(
250250
'FILE-STORAGE::',
251-
''
251+
'',
252252
)}`;
253253
}
254254
return (
@@ -257,10 +257,10 @@ export const BotBubble = (props: Props) => {
257257
</div>
258258
);
259259
} else if (item.type === 'html') {
260-
const src = (item.data as string);
260+
const src = item.data as string;
261261
return (
262262
<div class="mt-2">
263-
<div innerHTML={src}></div>
263+
<div innerHTML={src} />
264264
</div>
265265
);
266266
} else {
@@ -319,7 +319,7 @@ export const BotBubble = (props: Props) => {
319319
<div class="flex flex-row items-start flex-wrap w-full gap-2">
320320
<For each={props.message.artifacts}>
321321
{(item) => {
322-
return item !== null ? <>{renderArtifacts(item)}</> : null
322+
return item !== null ? <>{renderArtifacts(item)}</> : null;
323323
}}
324324
</For>
325325
</div>

0 commit comments

Comments
 (0)