mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Hide Stream settings when navigating to another pages
This commit is contained in:
parent
58b83c4eb2
commit
714276e552
@ -2,6 +2,7 @@ import { BxEvent } from "@utils/bx-event";
|
||||
import { LoadingScreen } from "@modules/loading-screen";
|
||||
import { RemotePlay } from "@modules/remote-play";
|
||||
import { HeaderSection } from "@/modules/ui/header";
|
||||
import { StreamSettings } from "@/modules/stream/stream-settings";
|
||||
|
||||
export function patchHistoryMethod(type: 'pushState' | 'replaceState') {
|
||||
const orig = window.history[type];
|
||||
@ -25,11 +26,17 @@ export function onHistoryChanged(e: PopStateEvent) {
|
||||
|
||||
window.setTimeout(RemotePlay.detect, 10);
|
||||
|
||||
// Hide Global settings
|
||||
const $settings = document.querySelector('.bx-settings-container');
|
||||
if ($settings) {
|
||||
$settings.classList.add('bx-gone');
|
||||
}
|
||||
|
||||
// Hide Stream settings
|
||||
if (document.querySelector('.' + StreamSettings.MAIN_CLASS)) {
|
||||
StreamSettings.getInstance().hide();
|
||||
}
|
||||
|
||||
// Hide Remote Play popup
|
||||
RemotePlay.detachPopup();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user