Removed recording-upload-complete event handler in favor of recording-stopped

This commit is contained in:
Kimberlee Johnson 2021-11-29 16:21:51 -08:00
parent d270fd3d34
commit e03dcdaaef
1 changed files with 3 additions and 10 deletions

View File

@ -106,20 +106,11 @@ export const RecordingProvider = ({ children }) => {
}
};
const handleRecordingUploadCompleted = () => {
setRecordingState(RECORDING_SAVED);
};
callObject.on('app-message', handleAppMessage);
callObject.on('recording-data', handleRecordingData);
callObject.on('recording-upload-completed', handleRecordingUploadCompleted);
return () => {
callObject.off('app-message', handleAppMessage);
callObject.off(
'recording-upload-completed',
handleRecordingUploadCompleted
);
};
}, [callObject, enableRecording]);
@ -213,7 +204,8 @@ export const RecordingProvider = ({ children }) => {
useEffect(() => {
if (!callObject || !enableRecording) return false;
const handleRecordingStopped = () => {
const handleRecordingStopped = (event) => {
console.log(event);
if (isRecordingLocally) return;
setRecordingState(RECORDING_IDLE);
setRecordingStartedDate(null);
@ -305,6 +297,7 @@ export const RecordingProvider = ({ children }) => {
case RECORDING_TYPE_CLOUD_BETA:
case RECORDING_TYPE_RTP_TRACKS:
setRecordingState(RECORDING_UPLOADING);
setRecordingState(RECORDING_SAVED);
break;
default:
break;