@ -115,7 +115,7 @@ async function onConversation() {
const xhr = event . target
const xhr = event . target
const { responseText } = xhr
const { responseText } = xhr
/ / A l w a y s p r o c e s s t h e f i n a l l i n e
/ / A l w a y s p r o c e s s t h e f i n a l l i n e
const lastIndex = responseText . lastIndexOf ( '\n' )
const lastIndex = responseText . lastIndexOf ( '\n' , responseText . length - 2 )
let chunk = responseText
let chunk = responseText
if ( lastIndex !== - 1 )
if ( lastIndex !== - 1 )
chunk = responseText . substring ( lastIndex )
chunk = responseText . substring ( lastIndex )
@ -245,7 +245,7 @@ async function onRegenerate(index: number) {
const xhr = event . target
const xhr = event . target
const { responseText } = xhr
const { responseText } = xhr
/ / A l w a y s p r o c e s s t h e f i n a l l i n e
/ / A l w a y s p r o c e s s t h e f i n a l l i n e
const lastIndex = responseText . lastIndexOf ( '\n' )
const lastIndex = responseText . lastIndexOf ( '\n' , responseText . length - 2 )
let chunk = responseText
let chunk = responseText
if ( lastIndex !== - 1 )
if ( lastIndex !== - 1 )
chunk = responseText . substring ( lastIndex )
chunk = responseText . substring ( lastIndex )