Skip to content

Commit

Permalink
clean ups
Browse files Browse the repository at this point in the history
  • Loading branch information
cpoile committed Mar 22, 2024
1 parent 6785154 commit 56ee0c6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions client/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,15 @@ func (c *Client) handleWSMsg(msg ws.Message) error {
if !ok {
return fmt.Errorf("invalid recording state")
}
var recState CallJobState
recState.FromMap(data)
c.emit(WSCallJobState, recState)
var jobState CallJobState
jobState.FromMap(data)
c.emit(WSCallJobState, jobState)

// Below is deprecated as of v0.14.0, kept for compatibility with earlier versions
// of transcriber
if recState.Type != "recording" {
return nil
if jobState.Type == "recording" {
c.emit(WSCallRecordingState, jobState)
}
c.emit(WSCallRecordingState, recState)
case wsEventJobStop:
jobID, _ := ev.GetData()["job_id"].(string)
c.emit(WSJobStopEvent, jobID)
Expand Down

0 comments on commit 56ee0c6

Please sign in to comment.