From e2e2322d943ffd3f762a36a875a4e47604843123 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Wed, 22 May 2024 18:38:51 +0700 Subject: [PATCH] Minor fixes --- src/modules/touch-controller.ts | 4 ++-- src/utils/bx-flags.ts | 2 ++ src/utils/global.ts | 2 -- src/utils/network.ts | 4 ++-- src/utils/translation.ts | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/touch-controller.ts b/src/modules/touch-controller.ts index 24bb86e..18aa099 100644 --- a/src/modules/touch-controller.ts +++ b/src/modules/touch-controller.ts @@ -1,8 +1,8 @@ -import { NATIVE_FETCH, STATES } from "@utils/global"; +import { STATES } from "@utils/global"; import { escapeHtml } from "@utils/html"; import { Toast } from "@utils/toast"; import { BxEvent } from "@utils/bx-event"; -import { BX_FLAGS } from "@utils/bx-flags"; +import { BX_FLAGS, NATIVE_FETCH } from "@utils/bx-flags"; import { getPref, PrefKey } from "@utils/preferences"; import { t } from "@utils/translation"; import { BxLogger } from "@utils/bx-logger"; diff --git a/src/utils/bx-flags.ts b/src/utils/bx-flags.ts index cb28738..9c0710e 100644 --- a/src/utils/bx-flags.ts +++ b/src/utils/bx-flags.ts @@ -23,3 +23,5 @@ export const BX_FLAGS = Object.assign(DEFAULT_FLAGS, window.BX_FLAGS || {}); try { delete window.BX_FLAGS; } catch (e) {} + +export const NATIVE_FETCH = window.fetch; diff --git a/src/utils/global.ts b/src/utils/global.ts index d4c468c..82d5cc3 100644 --- a/src/utils/global.ts +++ b/src/utils/global.ts @@ -5,8 +5,6 @@ export const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud'; export const AppInterface = window.AppInterface; -export const NATIVE_FETCH = window.fetch; - UserAgent.init(); const userAgent = window.navigator.userAgent.toLowerCase(); diff --git a/src/utils/network.ts b/src/utils/network.ts index 6dd650b..90420df 100644 --- a/src/utils/network.ts +++ b/src/utils/network.ts @@ -1,11 +1,11 @@ import { BxEvent } from "@utils/bx-event"; -import { BX_FLAGS } from "@utils/bx-flags"; +import { BX_FLAGS, NATIVE_FETCH } from "@utils/bx-flags"; import { LoadingScreen } from "@modules/loading-screen"; import { PrefKey, getPref } from "@utils/preferences"; import { RemotePlay } from "@modules/remote-play"; import { StreamBadges } from "@modules/stream/stream-badges"; import { TouchController } from "@modules/touch-controller"; -import { NATIVE_FETCH, STATES } from "@utils/global"; +import { STATES } from "@utils/global"; import { getPreferredServerRegion } from "@utils/region"; import { GamePassCloudGallery } from "./gamepass-gallery"; import { InputType } from "./bx-exposed"; diff --git a/src/utils/translation.ts b/src/utils/translation.ts index f0783b5..2a79feb 100644 --- a/src/utils/translation.ts +++ b/src/utils/translation.ts @@ -1,4 +1,4 @@ -import { NATIVE_FETCH } from "./global"; +import { NATIVE_FETCH } from "./bx-flags"; export const SUPPORTED_LANGUAGES = { 'en-US': 'English (United States)', @@ -364,4 +364,4 @@ export class Translations { export const t = Translations.get; -await Translations.init(); +Translations.init();