fix: refresh during generation

fixes #116
This commit is contained in:
Jing Hua 2023-03-25 13:58:17 +08:00
parent b04dbfa76b
commit b7848e8b8b

View file

@ -157,9 +157,11 @@ const ContentView = React.memo(
<div className='flex justify-end gap-2 w-full mt-2'> <div className='flex justify-end gap-2 w-full mt-2'>
{isDelete || ( {isDelete || (
<> <>
{role === 'assistant' && messageIndex === lastMessageIndex && ( {!useStore.getState().generating &&
<RefreshButton onClick={handleRefresh} /> role === 'assistant' &&
)} messageIndex === lastMessageIndex && (
<RefreshButton onClick={handleRefresh} />
)}
{messageIndex !== 0 && <UpButton onClick={handleMoveUp} />} {messageIndex !== 0 && <UpButton onClick={handleMoveUp} />}
{messageIndex !== lastMessageIndex && ( {messageIndex !== lastMessageIndex && (
<DownButton onClick={handleMoveDown} /> <DownButton onClick={handleMoveDown} />