Files
discord-decomp/sources/modules/go_live/GoLiveAutoQualityExperiment.tsx
T
2026-07-27 16:20:00 +03:00

70 lines
4.1 KiB
TypeScript

/* Metro module 10799; source: modules/go_live/GoLiveAutoQualityExperiment.tsx; dependencies: [1220, 4399, 4282, 1358, 566, 587, 8913, 2] */
function _fun82952(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82952, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10985:6, offset: 0x01f07cd7, size: 313 bytes, params: 8, frame: 24
var object6;
const env0_0 = require;
const closure = getGoLiveAutoQualityExperimentConfig;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const apexExperimentStore = importDefault(1220) /* metro dependency 1220: ApexExperimentStore */;
const applicationStreamingSettingsStore = importDefault(4399) /* metro dependency 4399: ApplicationStreamingSettingsStore */;
const env0_4 = (require(4282) /* metro dependency 4282: StreamSettingsConstants */).ApplicationStreamPresets;
object6 = {'allowAutoQuality': false, 'defaultAutoQuality': false, 'migrateAutoQuality': false};
const apexExperiment = importDefault(1358) /* metro dependency 1358: ApexExperiment */;
const object7 = {'name': '2025-10-go-live-auto-quality', 'kind': 'user'};
object7.defaultConfig = object6;
const object8 = {};
const object9 = {};
copyDataProperties(object9, object6, undefined);
object9['allowAutoQuality'] = true;
object9['migrateAutoQuality'] = true;
object8[1] = object9;
const object10 = {};
copyDataProperties(object10, object6, undefined);
object10['allowAutoQuality'] = true;
object10['defaultAutoQuality'] = true;
object8[2] = object10;
object7.variations = object8;
const env0_5 = apexExperiment(object7);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/go_live/GoLiveAutoQualityExperiment.tsx');
exports.getGoLiveAutoQualityExperimentConfig = closure;
exports.useGoLiveAutoQualityExperimentConfig = function({location}) {
return require(dependencyMap[4]).useStateFromStores([ApexExperimentStore], _fun82955);
};
exports.maybeMigrateToAutoQuality = maybeMigrateToAutoQuality;
}
function getGoLiveAutoQualityExperimentConfig({location}) { // fn#82953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10985:449, offset: 0x01f07e10, size: 34 bytes, params: 2, frame: 12
return env0_5.getConfig({location: location});
}
function useGoLiveAutoQualityExperimentConfig({location}) { // fn#82954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10985:738, offset: 0x01f07e32, size: 71 bytes, params: 2, frame: 14
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ApexExperimentStore], function() {
return getGoLiveAutoQualityExperimentConfig({location: location});
});
}
function maybeMigrateToAutoQuality() { // fn#82956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10985:923, offset: 0x01f07e96, size: 273 bytes, params: 1, frame: 20
var state;
const binding = env0_5;
const getConfig = binding.getConfig;
const migrateAutoQuality = Reflect.apply(getConfig, binding,
[{location: 'maybeMigrateToAutoQuality'}]).migrateAutoQuality;
const Number = global.Number;
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
if (migrateAutoQuality) {
if (!(Number(Storage.get('GoLiveAutoQualityMigrationVersion') ?? 0) >= 1)) {
state = ApplicationStreamingSettingsStore.getState();
if (state.preset !== ApplicationStreamPresets.PRESET_CUSTOM) {
(require(8913) /* metro dependency 8913: StreamActionCreators */).updateStreamSettings({preset: ApplicationStreamPresets.PRESET_AUTO,
resolution: state.resolution, frameRate: state.fps, soundshareEnabled: state.soundshareEnabled,
noTrack: true});
Storage.set('GoLiveAutoQualityMigrationVersion', 1);
}
}
}
}