Skip to content

Commit

Permalink
fix: loading status exit before response finish #14
Browse files Browse the repository at this point in the history
  • Loading branch information
OrenZhang committed Feb 4, 2024
1 parent 3491634 commit 700478a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/ChatInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const doChat = async () => {
.then((res) => {
// check success
if (!res.ok) {
emits('setChatLoading', false);
Message.error(res.statusText);
return;
}
Expand All @@ -121,12 +122,14 @@ const doChat = async () => {
lastResponseContent.value.content += value;
read();
}
if (chunk.done) {
emits('setChatLoading', false);
}
emits('saveMessage');
});
}
read();
})
.finally(() => emits('setChatLoading', false));
}, () => emits('setChatLoading', false));
};
const reGenerate = () => {
Expand Down

0 comments on commit 700478a

Please sign in to comment.