diff --git a/src/lib/Chat.svelte b/src/lib/Chat.svelte index 54967a2..a492179 100644 --- a/src/lib/Chat.svelte +++ b/src/lib/Chat.svelte @@ -453,13 +453,14 @@ const response = await fetch(getApiBase() + getEndpointCompletions(), fetchOptions) if (!response.ok) { await handleError(response) + } else { + const json = await response.json() + // Remove updating indicator + updating = false + updatingMessage = '' + chatResponse.updateFromSyncResponse(json) + scrollToBottom() } - const json = await response.json() - // Remove updating indicator - updating = false - updatingMessage = '' - chatResponse.updateFromSyncResponse(json) - scrollToBottom() } } catch (e) { // console.error(e)