From 7310a009df76a8f9aadd3ad1a5dcaac60ed252ad Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Fri, 8 Mar 2024 16:50:25 +0700 Subject: [PATCH] Update style of the Reload page button --- better-xcloud.user.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index 45f34f8..bf172ee 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -9882,6 +9882,7 @@ function injectSettingsButton($parent) { const PREF_LATEST_VERSION = getPref(Preferences.LATEST_VERSION); const $headerFragment = document.createDocumentFragment(); + let $reloadBtnWrapper; // Remote Play button if (getPref(Preferences.REMOTE_PLAY_ENABLED)) { @@ -10034,6 +10035,10 @@ function injectSettingsButton($parent) { $wrapper.appendChild($group); let onChange = e => { + if (!$reloadBtnWrapper) { + return; + } + $reloadBtnWrapper.classList.remove('bx-gone'); if (e.target.id === 'bx_setting_' + Preferences.BETTER_XCLOUD_LOCALE) { @@ -10153,7 +10158,7 @@ function injectSettingsButton($parent) { // Setup Reload button const $reloadBtn = createButton({ label: t('settings-reload'), - style: ButtonStyle.PRIMARY | ButtonStyle.FOCUSABLE | ButtonStyle.FULL_WIDTH, + style: ButtonStyle.DANGER | ButtonStyle.FOCUSABLE | ButtonStyle.FULL_WIDTH, onClick: e => { window.location.reload(); $reloadBtn.disabled = true; @@ -10162,7 +10167,7 @@ function injectSettingsButton($parent) { }); $reloadBtn.setAttribute('tabindex', 0); - const $reloadBtnWrapper = CE('div', {'class': 'bx-settings-reload-button-wrapper bx-gone'}, $reloadBtn); + $reloadBtnWrapper = CE('div', {'class': 'bx-settings-reload-button-wrapper bx-gone'}, $reloadBtn); $wrapper.appendChild($reloadBtnWrapper); // Donation link