Keep loading prompt after summary

This commit is contained in:
Webifi 2023-08-25 00:24:26 -05:00
parent d4e12b49fb
commit a8e7ad0ff6
2 changed files with 4 additions and 12 deletions

View File

@ -313,6 +313,8 @@
} catch (e) {
console.error('Error generating name suggestion', e, e.stack)
}
chatRequest.updating = false
chatRequest.updatingMessage = ''
if (response.hasError()) {
addMessage(chatId, {
role: 'error',

View File

@ -37,8 +37,8 @@ export const chatRequest = async (
* We'll get the response a token at a time, as soon as they are ready
*/
chatResponse.onFinish(() => {
chatRequest.updating = false
chatRequest.updatingMessage = ''
// chatRequest.updating = false
// chatRequest.updatingMessage = ''
})
fetchEventSource(getEndpoint(model), {
...fetchOptions,
@ -59,8 +59,6 @@ export const chatRequest = async (
}
},
onclose () {
chatRequest.updating = false
chatRequest.updatingMessage = ''
chatResponse.updateFromClose()
},
onerror (err) {
@ -76,8 +74,6 @@ export const chatRequest = async (
}
}
}).catch(err => {
chatRequest.updating = false
chatRequest.updatingMessage = ''
chatResponse.updateFromError(err.message)
})
} else {
@ -90,9 +86,6 @@ export const chatRequest = async (
await chatRequest.handleError(response)
} else {
const json = await response.json()
// Remove updating indicator
chatRequest.updating = false
chatRequest.updatingMessage = ''
chatResponse.updateFromSyncResponse(json)
}
}
@ -156,9 +149,6 @@ export const imageRequest = async (
await chatRequest.handleError(response)
} else {
const json = await response.json()
// Remove updating indicator
chatRequest.updating = false
chatRequest.updatingMessage = ''
// console.log('image json', json, json?.data[0])
const images = json?.data.map(d => d.b64_json)
chatResponse.updateImageFromSyncResponse(images, prompt, imageModel)