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); buttons.push(GuideMenu.#BUTTONS.streamSetting);
AppInterface && buttons.push(GuideMenu.#BUTTONS.appSettings); 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); const $buttons = GuideMenu.#renderButtons(buttons);
$btnQuit.insertAdjacentElement('afterend', $buttons); $btnQuit.insertAdjacentElement('afterend', $buttons);
@ -117,11 +123,13 @@ export class GuideMenu {
const where = (e as any).where as GuideMenuTab; const where = (e as any).where as GuideMenuTab;
if (where === GuideMenuTab.HOME) { 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 (STATES.isPlaying) { if ($root) {
GuideMenu.#injectHomePlaying($root); if (STATES.isPlaying) {
} else { GuideMenu.#injectHomePlaying($root);
GuideMenu.#injectHome($root); } else {
GuideMenu.#injectHome($root);
}
} }
} }
} }