From 13c22ea16f7c0672deabf4b01a1f5a4631ace3a5 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 6 Nov 2022 21:42:58 -0600 Subject: [PATCH] Fix last frame from previous session displaying when starting a new one --- static/js/index.js | 3 +++ static/js/messages.js | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/index.js b/static/js/index.js index ceff494..f27e6d2 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -722,6 +722,9 @@ function playGameMode() { $("#main-content").addClass("fullscreen"); $("#listener").addClass("fullscreen"); + // Hide the NaCl module until the first frame is rendered + $("#nacl_module")[0].style.opacity = 0.0 + fullscreenNaclModule(); $('#loadingSpinner').css('display', 'inline-block'); } diff --git a/static/js/messages.js b/static/js/messages.js index b6348ce..c9ecf42 100644 --- a/static/js/messages.js +++ b/static/js/messages.js @@ -80,7 +80,8 @@ function handleMessage(msg) { // FIXME: Really use a dialog snackbarLogLong(msg.data.replace('DialogMsg: ', '')); } else if (msg.data === 'displayVideo') { - $("#listener").addClass("fullscreen"); + // Show the video stream now + $("#nacl_module")[0].style.opacity = 1.0; } else if (msg.data.indexOf('controllerRumble: ' ) === 0) { const eventData = msg.data.split( ' ' )[1].split(','); const gamepadIdx = parseInt(eventData[0]);