Fix problems in the Guide menu #436 #438

This commit is contained in:
redphx 2024-07-07 11:20:43 +07:00
parent 5763701355
commit 77729789e3

View File

@ -105,6 +105,12 @@ export class GuideMenu {
buttons.push(GuideMenu.#BUTTONS.streamSetting);
AppInterface && buttons.push(GuideMenu.#BUTTONS.appSettings);
// Reload stream
buttons.push(GuideMenu.#BUTTONS.reloadStream);
// Back to home
buttons.push(GuideMenu.#BUTTONS.backToHome);
const $buttons = GuideMenu.#renderButtons(buttons);
$btnQuit.insertAdjacentElement('afterend', $buttons);
@ -117,7 +123,8 @@ export class GuideMenu {
const where = (e as any).where as GuideMenuTab;
if (where === GuideMenuTab.HOME) {
const $root = document.querySelector('#gamepass-dialog-root div[role=dialog]') as HTMLElement;
const $root = document.querySelector('#gamepass-dialog-root div[role=dialog] div[role=tabpanel] div[class*=HomeLandingPage]') as HTMLElement;
if ($root) {
if (STATES.isPlaying) {
GuideMenu.#injectHomePlaying($root);
} else {
@ -125,6 +132,7 @@ export class GuideMenu {
}
}
}
}
static observe() {
window.addEventListener(BxEvent.XCLOUD_GUIDE_MENU_SHOWN, GuideMenu.#onShown);