From 0f074b1e375a8d4729f26ac1d7ffcdf1601adaa3 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Wed, 16 Apr 2025 23:32:06 +0530 Subject: [PATCH] wip --- web/app/assets/javascripts/recordingModel.js | 25 ++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/web/app/assets/javascripts/recordingModel.js b/web/app/assets/javascripts/recordingModel.js index 1412a1f5e..6c7dd32a8 100644 --- a/web/app/assets/javascripts/recordingModel.js +++ b/web/app/assets/javascripts/recordingModel.js @@ -206,11 +206,32 @@ } function onServerStartRecording() { - + var session = context.SessionStore.getCurrentOrLastSession(); + if (!session) { + logger.debug("no session, so no recording"); + return; + } + context.SessionStore.updateSessionInfo(session) } function onServerStopRecording(recordingId) { - stopRecording(recordingId, null, null); + var session = context.SessionStore.getCurrentOrLastSession(); + + if (!session) { + logger.debug("no session, so no recording"); + return; + } + context.SessionStore.updateSessionInfo(session) + + getCurrentRecordingState().then(function (recordingState) { + if (recordingState.isRecording && recordingState.recordingOwnerId === app.currentUserId) { + // we are still recording, so don't transition to stopped + logger.debug("recording is still running, so don't transition to stopped"); + return; + } + stopRecording(recordingId, null, null); + }); + } async function handleRecordingStartResult(recordingId, result) {