This commit is contained in:
redphx
2024-12-05 17:10:39 +07:00
parent c836e33f7b
commit 9199351af1
207 changed files with 9833 additions and 6953 deletions

23
src/utils/feature-gates.ts Normal file → Executable file
View File

@@ -1,17 +1,30 @@
import { PrefKey } from "@/enums/pref-keys";
import { BX_FLAGS } from "./bx-flags";
import { getPref } from "./settings-storages/global-settings-storage";
import { NativeMkbMode } from "@/enums/pref-values";
export let FeatureGates: {[key: string]: boolean} = {
'PwaPrompt': false,
'EnableWifiWarnings': false,
'EnableUpdateRequiredPage': false,
'ShowForcedUpdateScreen': false,
PwaPrompt: false,
EnableWifiWarnings: false,
EnableUpdateRequiredPage: false,
ShowForcedUpdateScreen: false,
};
// Enable Native Mouse & Keyboard
const nativeMkbMode = getPref<NativeMkbMode>(PrefKey.NATIVE_MKB_MODE);
if (nativeMkbMode !== NativeMkbMode.DEFAULT) {
FeatureGates.EnableMouseAndKeyboard = nativeMkbMode === NativeMkbMode.ON;
}
// Disable chat feature
if (getPref(PrefKey.BLOCK_SOCIAL_FEATURES)) {
FeatureGates['EnableGuideChatTab'] = false;
FeatureGates.EnableGuideChatTab = false;
}
// Disable BYOG feature
if (getPref(PrefKey.BYOG_DISABLED)) {
FeatureGates.EnableBYOG = false;
FeatureGates.EnableBYOGPurchase = false;
}
if (BX_FLAGS.FeatureGates) {