Refactor header.ts

This commit is contained in:
redphx
2024-07-13 18:00:15 +07:00
parent 66d5d9edc6
commit 5bfcf3a044
5 changed files with 73 additions and 65 deletions

View File

@@ -1,7 +1,7 @@
import { BxEvent } from "@utils/bx-event";
import { LoadingScreen } from "@modules/loading-screen";
import { RemotePlay } from "@modules/remote-play";
import { checkHeader } from "@modules/ui/header";
import { HeaderSection } from "@/modules/ui/header";
export function patchHistoryMethod(type: 'pushState' | 'replaceState') {
const orig = window.history[type];
@@ -34,7 +34,7 @@ export function onHistoryChanged(e: PopStateEvent) {
RemotePlay.detachPopup();
LoadingScreen.reset();
window.setTimeout(checkHeader, 2000);
window.setTimeout(HeaderSection.watchHeader, 2000);
BxEvent.dispatch(window, BxEvent.STREAM_STOPPED);
}

View File

@@ -25,9 +25,6 @@ class XcloudInterceptor {
const obj = await response.clone().json();
// Preload Remote Play
getPref(PrefKey.REMOTE_PLAY_ENABLED) && BX_FLAGS.PreloadRemotePlay && RemotePlay.preload();
// Store xCloud token
RemotePlay.XCLOUD_TOKEN = obj.gsToken;