mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-21 09:47:13 +00:00
fix: frontend bug
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { httpClient } from '@/app/infra/http/HttpClient';
|
import { httpClient } from '@/app/infra/http/HttpClient';
|
||||||
import { DialogContent } from '@/components/ui/dialog';
|
import { DialogContent } from '@/components/ui/dialog';
|
||||||
@@ -46,7 +46,7 @@ export default function DebugDialog({
|
|||||||
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadMessages = async (pipelineId: string) => {
|
const loadMessages = useCallback(async (pipelineId: string) => {
|
||||||
try {
|
try {
|
||||||
const response = await httpClient.getWebChatHistoryMessages(
|
const response = await httpClient.getWebChatHistoryMessages(
|
||||||
pipelineId,
|
pipelineId,
|
||||||
@@ -56,7 +56,7 @@ export default function DebugDialog({
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to load messages:', error);
|
console.error('Failed to load messages:', error);
|
||||||
}
|
}
|
||||||
};
|
}, [sessionType]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
@@ -214,7 +214,7 @@ export default function DebugDialog({
|
|||||||
content: accumulatedContent,
|
content: accumulatedContent,
|
||||||
message_chain: [
|
message_chain: [
|
||||||
{ type: 'Plain', text: accumulatedContent },
|
{ type: 'Plain', text: accumulatedContent },
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
updatedMessages[botMessageIndex] = updatedBotMessage;
|
updatedMessages[botMessageIndex] = updatedBotMessage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import {
|
|||||||
import { GetBotLogsRequest } from '@/app/infra/http/requestParam/bots/GetBotLogsRequest';
|
import { GetBotLogsRequest } from '@/app/infra/http/requestParam/bots/GetBotLogsRequest';
|
||||||
import { GetBotLogsResponse } from '@/app/infra/http/requestParam/bots/GetBotLogsResponse';
|
import { GetBotLogsResponse } from '@/app/infra/http/requestParam/bots/GetBotLogsResponse';
|
||||||
|
|
||||||
|
|
||||||
type JSONValue = string | number | boolean | JSONObject | JSONArray | null;
|
type JSONValue = string | number | boolean | JSONObject | JSONArray | null;
|
||||||
interface JSONObject {
|
interface JSONObject {
|
||||||
[key: string]: JSONValue;
|
[key: string]: JSONValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user