From dc56e323573e0e6404f35b60258a30befa71aa44 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Tue, 2 Apr 2024 07:31:12 +0700 Subject: [PATCH] Fix getting Remote Play consoles multiple times --- better-xcloud.user.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index 07d130d..3df2718 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -3766,8 +3766,11 @@ class RemotePlay { REMOTE_PLAY_SERVER = server; callback(); - break; } catch (e) {} + + if (RemotePlay.#CONSOLES) { + break; + } } // None of the servers worked @@ -10248,9 +10251,6 @@ function injectSettingsButton($parent) { }, }); $headerFragment.appendChild($remotePlayBtn); - - // Preload Remote Play - BX_FLAGS.PreloadRemotePlay && RemotePlay.preload() } @@ -11712,6 +11712,11 @@ BX_FLAGS.PreloadUi && setupBxUi(); disablePwa(); +// Preload Remote Play +if (getPref(Preferences.REMOTE_PLAY_ENABLED)) { + BX_FLAGS.PreloadRemotePlay && RemotePlay.preload(); +} + /* if (getPref(Preferences.CONTROLLER_ENABLE_SHORTCUTS)) { GamepadHandler.initialSetup();