App option to disable context menu in Home page

This commit is contained in:
redphx
2024-05-19 10:43:44 +07:00
parent afd851861a
commit 88b63a5518
4 changed files with 40 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import { STATES } from "@utils/global";
import { BxLogger } from "./bx-logger";
import { TouchController } from "@modules/touch-controller";
import { GamePassCloudGallery } from "./gamepass-gallery";
import { getPref, PrefKey } from "./preferences";
const LOG_TAG = 'PreloadState';
@@ -41,6 +42,14 @@ export function overridePreloadState() {
}
}
if (getPref(PrefKey.UI_HOME_CONTEXT_MENU_DISABLED)) {
try {
state.experiments.experimentationInfo.data.treatments.EnableHomeContextMenu = false;
} catch (e) {
BxLogger.error(LOG_TAG, e);
}
}
// @ts-ignore
_state = state;
STATES.appContext = structuredClone(state.appContext);