Browse Source

fix: buffer not return event show errors (#149)

Joel 1 year ago
parent
commit
2d0d3365ed
1 changed files with 1 additions and 1 deletions
  1. 1 1
      web/service/base.ts

+ 1 - 1
web/service/base.ts

@@ -78,7 +78,7 @@ const handleStream = (response: any, onData: IOnData, onCompleted?: IOnCompleted
           if (message.startsWith('data: ')) { // check if it starts with data:
             // console.log(message);
             bufferObj = JSON.parse(message.substring(6)) // remove data: and parse as json
-            if (bufferObj.status === 400) {
+            if (bufferObj.status === 400 || !bufferObj.event) {
               onData('', false, {
                 conversationId: undefined,
                 messageId: '',