mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 08:07:18 +02:00
Add "Reload page" button to the Guide menu even when not playing
This commit is contained in:
parent
714276e552
commit
0fb83de0ff
@ -43,11 +43,18 @@ export class GuideMenu {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
reloadStream: createButton({
|
reloadPage: createButton({
|
||||||
label: t('reload-page'),
|
label: t('reload-page'),
|
||||||
style: ButtonStyle.FULL_WIDTH | ButtonStyle.FOCUSABLE,
|
style: ButtonStyle.FULL_WIDTH | ButtonStyle.FOCUSABLE,
|
||||||
onClick: e => {
|
onClick: e => {
|
||||||
confirm(t('confirm-reload-stream')) && window.location.reload();
|
if (STATES.isPlaying) {
|
||||||
|
confirm(t('confirm-reload-stream')) && window.location.reload();
|
||||||
|
} else {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close all xCloud's dialogs
|
||||||
|
window.BX_EXPOSED.dialogRoutes.closeAll();
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@ -88,6 +95,9 @@ export class GuideMenu {
|
|||||||
buttons.push(GuideMenu.#BUTTONS.closeApp);
|
buttons.push(GuideMenu.#BUTTONS.closeApp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reload page
|
||||||
|
buttons.push(GuideMenu.#BUTTONS.reloadPage);
|
||||||
|
|
||||||
const $buttons = GuideMenu.#renderButtons(buttons);
|
const $buttons = GuideMenu.#renderButtons(buttons);
|
||||||
|
|
||||||
const $lastDivider = $dividers[$dividers.length - 1];
|
const $lastDivider = $dividers[$dividers.length - 1];
|
||||||
@ -105,8 +115,8 @@ 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
|
// Reload page
|
||||||
buttons.push(GuideMenu.#BUTTONS.reloadStream);
|
buttons.push(GuideMenu.#BUTTONS.reloadPage);
|
||||||
|
|
||||||
// Back to home
|
// Back to home
|
||||||
buttons.push(GuideMenu.#BUTTONS.backToHome);
|
buttons.push(GuideMenu.#BUTTONS.backToHome);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user