Skip to content

Commit

Permalink
rebased with the dev
Browse files Browse the repository at this point in the history
  • Loading branch information
iAmmar7 committed Apr 4, 2023
1 parent 624e697 commit f0c756b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/realtime-api/src/voice/CallPlayback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ export class CallPlaybackAPI
this._once('playback.ended', handler)
// @ts-expect-error
this._once('playback.failed', handler)

// Resolve the promise if the recording has already ended
if (ENDED_STATES.includes(this.state as CallingCallPlayEndState)) {
handler()
}
})
}
}
Expand Down
5 changes: 5 additions & 0 deletions packages/realtime-api/src/voice/CallRecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ export class CallRecordingAPI
// TODO: review what else to return when `recording.failed` happens.
// @ts-expect-error
this._once('recording.failed', handler)

// Resolve the promise if the recording has already ended
if (ENDED_STATES.includes(this.state as CallingCallRecordEndState)) {
handler()
}
})
}
}
Expand Down

0 comments on commit f0c756b

Please sign in to comment.