Fix not clearing states when quitting game while queueing

This commit is contained in:
redphx 2024-09-04 16:43:39 +07:00
parent 03ad02bd4d
commit 53d67616c3

View File

@ -282,10 +282,13 @@ window.addEventListener(BxEvent.DATA_CHANNEL_CREATED, e => {
});
function unload() {
if (!STATES.isPlaying) {
if (!STATES.isPlaying && !Object.keys(STATES.currentStream).length) {
return;
}
STATES.isPlaying = false;
STATES.currentStream = {};
// Stop MKB listeners
EmulatedMkbHandler.getInstance().destroy();
NativeMkbHandler.getInstance().destroy();
@ -293,8 +296,6 @@ function unload() {
// Destroy StreamPlayer
STATES.currentStream.streamPlayer?.destroy();
STATES.isPlaying = false;
STATES.currentStream = {};
window.BX_EXPOSED.shouldShowSensorControls = false;
window.BX_EXPOSED.stopTakRendering = false;