fix : message not displayed bug

This commit is contained in:
martin legrand
2025-04-18 17:54:47 +02:00
parent 600bff8da4
commit 7f3682e884
2 changed files with 2 additions and 3 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ function App() {
const [currentView, setCurrentView] = useState('blocks');
const [responseData, setResponseData] = useState(null);
const [isOnline, setIsOnline] = useState(false);
const [status, setStatus] = useState('No agent working.');
const [status, setStatus] = useState('Agents ready');
const messagesEndRef = useRef(null);
useEffect(() => {
@@ -72,7 +72,7 @@ function App() {
const res = await axios.get('http://0.0.0.0:8000/latest_answer');
const data = res.data;
const answerExists = messages.some(
(msg) => msg.timestamp === data.timestamp || data.answer != undefined
(msg) => msg.timestamp === data.timestamp || data.answer === undefined
);
if (!answerExists) {
setMessages((prev) => [