feat: add regenerate to all response message as official

This commit is contained in:
Wentao Lyu 2023-03-17 01:49:09 +08:00
parent e3b0cb7db7
commit 0891566d1e
8 changed files with 211 additions and 177 deletions

View file

@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import Message from './Message';
export default function MultiMessage({
@ -14,6 +14,11 @@ export default function MultiMessage({
setSiblingIdx(messageList?.length - value - 1);
};
useEffect(() => {
// reset siblingIdx when changes, mostly a new message is submitting.
setSiblingIdx(0);
}, [messageList?.length])
// if (!messageList?.length) return null;
if (!(messageList && messageList.length)) {
return null;