GUACAMOLE-462: Do not continue an outstanding state import if its corresponding seek has been cancelled.

This commit is contained in:
Michael Jumper
2022-03-02 17:34:35 +00:00
parent d4899f102f
commit 27c7ab782f

View File

@@ -607,8 +607,14 @@ Guacamole.SessionRecording = function SessionRecording(source) {
// current state // current state
if (frame.clientState) { if (frame.clientState) {
frame.clientState.text().then(function textReady(text) { frame.clientState.text().then(function textReady(text) {
// Cancel seek if aborted
if (thisSeek.aborted)
return;
playbackClient.importState(JSON.parse(text)); playbackClient.importState(JSON.parse(text));
currentFrame = index; currentFrame = index;
}); });
break; break;
} }
@@ -629,7 +635,7 @@ Guacamole.SessionRecording = function SessionRecording(source) {
return; return;
// If frames remain, replay the next frame // If frames remain, replay the next frame
if (!thisSeek.aborted && currentFrame < index) if (currentFrame < index)
replayFrame(currentFrame + 1, continueReplay); replayFrame(currentFrame + 1, continueReplay);
// Otherwise, the seek operation is completed // Otherwise, the seek operation is completed