Skip to content

Commit

Permalink
fix: message errors should be added to the message
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdjohnson committed Nov 8, 2024
1 parent b27d84d commit 7797715
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/IncomingMessageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class IncomingMessageStore {

shouldDeleteMessage = _.isEmpty(messageToEdit.content)
} else if (error instanceof Error) {
messageToEdit.setError(error)
await messageToEdit.setError(error)

// make sure the server is still connected
connectionStore.selectedConnection?.fetchLmModels()
Expand Down
8 changes: 4 additions & 4 deletions src/core/message/MessageViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ export class MessageViewModel {
3000,
)

setError(errorData: Error) {
const error = MessageErrorModel.safeParse(errorData)
async setError(errorData: Error) {
const { data: error } = MessageErrorModel.safeParse(errorData)

const extras = MessageExtrasModel.safeParse({ ...this.source.extras, error })
const { data: extras } = MessageExtrasModel.safeParse({ ...this.source.extras, error })

this.update({ extras })
return this.update({ extras })
}

async setExtraDetails(detailObject?: Record<string, unknown>) {
Expand Down

0 comments on commit 7797715

Please sign in to comment.