Remove "ui_home_context_menu_disabled" setting as it's no longer needed

This commit is contained in:
redphx 2024-10-18 21:41:21 +07:00
parent 82cfb11a6d
commit 7578671cc3
8 changed files with 16 additions and 43 deletions

View File

@ -1482,11 +1482,6 @@ class GlobalSettingsStorage extends BaseSettingsStore {
label: t("hide-scrollbar"),
default: !1
},
ui_home_context_menu_disabled: {
requiredVariants: "full",
label: t("disable-home-context-menu"),
default: STATES.browser.capabilities.touch
},
ui_hide_sections: {
requiredVariants: "full",
label: t("hide-sections"),
@ -3130,7 +3125,6 @@ var FeatureGates = {
EnableUpdateRequiredPage: !1,
ShowForcedUpdateScreen: !1
};
if (getPref("ui_home_context_menu_disabled")) FeatureGates.EnableHomeContextMenu = !1;
if (getPref("block_social_features")) FeatureGates.EnableGuideChatTab = !1;
if (BX_FLAGS.FeatureGates) FeatureGates = Object.assign(BX_FLAGS.FeatureGates, FeatureGates);
class FullscreenText {
@ -3286,7 +3280,6 @@ class SettingsNavigationDialog extends NavigationDialog {
items: [
"ui_layout",
"ui_game_card_show_wait_time",
"ui_home_context_menu_disabled",
"controller_show_connection_status",
"stream_simplify_menu",
"skip_splash_video",

View File

@ -1508,11 +1508,6 @@ class GlobalSettingsStorage extends BaseSettingsStore {
label: t("hide-scrollbar"),
default: !1
},
ui_home_context_menu_disabled: {
requiredVariants: "full",
label: t("disable-home-context-menu"),
default: STATES.browser.capabilities.touch
},
ui_hide_sections: {
requiredVariants: "full",
label: t("hide-sections"),
@ -3896,7 +3891,6 @@ var FeatureGates = {
EnableUpdateRequiredPage: !1,
ShowForcedUpdateScreen: !1
};
if (getPref("ui_home_context_menu_disabled")) FeatureGates.EnableHomeContextMenu = !1;
if (getPref("block_social_features")) FeatureGates.EnableGuideChatTab = !1;
if (BX_FLAGS.FeatureGates) FeatureGates = Object.assign(BX_FLAGS.FeatureGates, FeatureGates);
class PatcherUtils {
@ -4647,7 +4641,6 @@ class SettingsNavigationDialog extends NavigationDialog {
items: [
"ui_layout",
"ui_game_card_show_wait_time",
"ui_home_context_menu_disabled",
"controller_show_connection_status",
"stream_simplify_menu",
"skip_splash_video",
@ -6808,11 +6801,6 @@ function overridePreloadState() {
} catch (e) {
BxLogger.error(LOG_TAG6, e);
}
if (getPref("ui_home_context_menu_disabled")) try {
state.experiments.experimentationInfo.data.treatments.EnableHomeContextMenu = !1;
} catch (e) {
BxLogger.error(LOG_TAG6, e);
}
_state = state, STATES.appContext = deepClone(state.appContext);
}
});

View File

@ -69,7 +69,6 @@ export enum PrefKey {
UI_SCROLLBAR_HIDE = 'ui_scrollbar_hide',
UI_HIDE_SECTIONS = 'ui_hide_sections',
UI_HOME_CONTEXT_MENU_DISABLED = 'ui_home_context_menu_disabled',
UI_GAME_CARD_SHOW_WAIT_TIME = 'ui_game_card_show_wait_time',
VIDEO_PLAYER_TYPE = 'video_player_type',

View File

@ -951,7 +951,22 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
str = PatcherUtils.replaceWith(str, index, '.All', '.Locked');
return str;
}
},
/*
// Disable long touch activating context menu
disableTouchContextMenu(str: string) {
let index = str.indexOf('"ContextualCardActions-module__container');
index >= 0 && (index = str.indexOf('addEventListener("touchstart"', index));
index >= 0 && (index = PatcherUtils.lastIndexOf(str, 'return ', index, 50));
if (index < 0) {
return false;
}
str = PatcherUtils.replaceWith(str, index, 'return', 'return null;');
return str;
},
*/
};
let PATCH_ORDERS: PatchArray = [

View File

@ -246,7 +246,6 @@ export class SettingsNavigationDialog extends NavigationDialog {
items: [
PrefKey.UI_LAYOUT,
PrefKey.UI_GAME_CARD_SHOW_WAIT_TIME,
PrefKey.UI_HOME_CONTEXT_MENU_DISABLED,
PrefKey.CONTROLLER_SHOW_CONNECTION_STATUS,
PrefKey.STREAM_SIMPLIFY_MENU,
PrefKey.SKIP_SPLASH_VIDEO,

View File

@ -9,11 +9,6 @@ export let FeatureGates: {[key: string]: boolean} = {
'ShowForcedUpdateScreen': false,
};
// Disable context menu in Home page
if (getPref(PrefKey.UI_HOME_CONTEXT_MENU_DISABLED)) {
FeatureGates['EnableHomeContextMenu'] = false;
}
// Disable chat feature
if (getPref(PrefKey.BLOCK_SOCIAL_FEATURES)) {
FeatureGates['EnableGuideChatTab'] = false;

View File

@ -3,8 +3,6 @@ import { BxLogger } from "./bx-logger";
import { TouchController } from "@modules/touch-controller";
import { GamePassCloudGallery } from "../enums/game-pass-gallery";
import { BX_FLAGS } from "./bx-flags";
import { PrefKey } from "@/enums/pref-keys";
import { getPref } from "./settings-storages/global-settings-storage";
const LOG_TAG = 'PreloadState';
@ -50,14 +48,6 @@ 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 = deepClone(state.appContext);

View File

@ -533,12 +533,6 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
default: false,
},
[PrefKey.UI_HOME_CONTEXT_MENU_DISABLED]: {
requiredVariants: 'full',
label: t('disable-home-context-menu'),
default: STATES.browser.capabilities.touch,
},
[PrefKey.UI_HIDE_SECTIONS]: {
requiredVariants: 'full',
label: t('hide-sections'),