mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Open Settings dialog on Unsupported page
This commit is contained in:
parent
362638ff0c
commit
e822072836
@ -37,6 +37,7 @@ import { NavigationDialogManager } from "./modules/ui/dialog/navigation-dialog";
|
||||
import { PrefKey } from "./enums/pref-keys";
|
||||
import { getPref } from "./utils/settings-storages/global-settings-storage";
|
||||
import { compressCss } from "@macros/build" with {type: "macro"};
|
||||
import { SettingsNavigationDialog } from "./modules/ui/dialog/settings-dialog";
|
||||
|
||||
|
||||
// Handle login page
|
||||
@ -145,6 +146,9 @@ window.history.replaceState = patchHistoryMethod('replaceState');
|
||||
window.addEventListener(BxEvent.XCLOUD_SERVERS_UNAVAILABLE, e => {
|
||||
STATES.supportedRegion = false;
|
||||
window.setTimeout(HeaderSection.watchHeader, 2000);
|
||||
|
||||
// Open Settings dialog on Unsupported page
|
||||
SettingsNavigationDialog.getInstance().show();
|
||||
});
|
||||
|
||||
window.addEventListener(BxEvent.XCLOUD_SERVERS_READY, e => {
|
||||
|
@ -58,8 +58,11 @@ export class HeaderSection {
|
||||
|
||||
static checkHeader() {
|
||||
if (!HeaderSection.#$buttonsWrapper.isConnected) {
|
||||
const $rightHeader = document.querySelector('#PageContent div[class*=EdgewaterHeader-module__rightSectionSpacing]');
|
||||
HeaderSection.#injectSettingsButton($rightHeader as HTMLElement);
|
||||
let $target = document.querySelector('#PageContent div[class*=EdgewaterHeader-module__rightSectionSpacing]');
|
||||
if (!$target) {
|
||||
$target = document.querySelector("div[class^=UnsupportedMarketPage-module__buttons]");
|
||||
}
|
||||
$target && HeaderSection.#injectSettingsButton($target as HTMLElement);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user