From 714276e55273ad3da1e648a6882270be724464cf Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:40:08 +0700 Subject: [PATCH] Hide Stream settings when navigating to another pages --- src/utils/history.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils/history.ts b/src/utils/history.ts index 7d314c4..359f56e 100644 --- a/src/utils/history.ts +++ b/src/utils/history.ts @@ -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();