Skip to content

Commit

Permalink
fix: remove unnecessary complexity from close event
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeocodes committed Dec 5, 2023
1 parent 2734f69 commit 24f53a9
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/packages/LiveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@ export class LiveClient extends AbstractWsClient {
};

this._socket.onclose = (event: any) => {
/**
* changing the event.target to any to access the private _req
* property that isn't available on the WebSocket.CloseEvent type
**/
const newTarget: any = event.target;

if (newTarget["_req"]) {
const dgErrorIndex = newTarget["_req"].res.rawHeaders.indexOf("dg-error");
event.reason = newTarget["_req"].res.rawHeaders[dgErrorIndex + 1];
}

this.emit(LiveTranscriptionEvents.Close, event);
};

Expand Down

0 comments on commit 24f53a9

Please sign in to comment.