Skip to content

Commit

Permalink
Fix onSubmit return promise used by test to wait for response
Browse files Browse the repository at this point in the history
  • Loading branch information
codewithcheese committed Aug 1, 2024
1 parent f13e2fd commit d23473a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/chat-service.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export class ChatService {
}

submit(requestOptions: ChatRequestOptions = {}) {
this.triggerRequest(this.createChatRequest(requestOptions));
return this.triggerRequest(this.createChatRequest(requestOptions));
}

handleOnFinish = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/routes/(app)/chat/[id]/revise/RevisePage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
if (lastMessage && lastMessage.role === "assistant") {
chatService.messages.pop();
}
return chatService.submit({
chatService.submit({
options: {
body: {
providerId: model.service.providerId,
Expand All @@ -107,6 +107,7 @@
},
},
});
return true;
}
onMount(() => {
Expand Down

0 comments on commit d23473a

Please sign in to comment.