From 56ee0c64536011ec814c3fc57de2e06c90f1ce12 Mon Sep 17 00:00:00 2001 From: Christopher Poile Date: Fri, 22 Mar 2024 09:16:51 -0400 Subject: [PATCH] clean ups --- client/websocket.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/client/websocket.go b/client/websocket.go index 7759716..0a019cf 100644 --- a/client/websocket.go +++ b/client/websocket.go @@ -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)