decord/source/modules/user_settings/UnsyncedUserSettingsStore.tsx

374 lines
12 KiB
TypeScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 1280
2026-07-23 10:11:24 +00:00
// Function ID: 14452
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-23 10:11:24 +00:00
// Dependencies: [6, 7, 15, 17, 18, 1281, 662, 653, 1314, 1315, 566, 587, 22, 686, 2]
2026-07-20 16:05:17 +00:00
// Module 1280 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import MAX_FAVORITES from "MAX_FAVORITES";
import closure_4 from "ME";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import { SystemThemeState } from "SystemThemeState";
import { ListDensityMode } from "MAX_FAVORITES";
import ME from "ME";
import { ExpressionPickerWidths } from "ExpressionPickerViewType";
2026-07-20 16:05:17 +00:00
let CHANNEL_SIDEBAR_WIDTH;
2026-07-23 10:11:24 +00:00
let closure_10;
const require = arg1;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
2026-07-23 10:11:24 +00:00
({ DEFAULT_CHAT_SIDEBAR_WIDTH: closure_10, CHANNEL_SIDEBAR_WIDTH } = ME);
let closure_12 = ME.DEFAULT_MESSAGE_REQUEST_SIDEBAR_WIDTH;
2026-07-20 16:05:17 +00:00
let obj = { DATA_SAVER: "data_saver", STANDARD: "standard", BEST: "best" };
let closure_14 = (window.innerWidth - CHANNEL_SIDEBAR_WIDTH) / 2;
const STANDARD = obj.STANDARD;
2026-07-23 10:11:24 +00:00
let c16 = null;
2026-07-20 16:05:17 +00:00
let closure_17 = {};
2026-07-23 10:11:24 +00:00
let tmp3 = ((DeviceSettingsStore) => {
2026-07-20 16:05:17 +00:00
class UnsyncedUserSettingsStore {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_3(this, UnsyncedUserSettingsStore);
obj = outer1_6(UnsyncedUserSettingsStore);
tmp2 = outer1_5;
if (outer1_18()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_6;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_6(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(UnsyncedUserSettingsStore, DeviceSettingsStore);
let obj = {
key: "initialize",
value(arg0) {
let obj = arg0;
if (null == arg0) {
obj = {};
}
2026-07-23 10:11:24 +00:00
const outer1_17 = obj;
2026-07-20 16:05:17 +00:00
const useSystemTheme = obj.useSystemTheme;
if (null != useSystemTheme) {
2026-07-23 10:11:24 +00:00
if (null != outer1_1(outer1_2[9])()) {
2026-07-20 16:05:17 +00:00
let UNSET = useSystemTheme;
}
obj.useSystemTheme = UNSET;
2026-07-23 10:11:24 +00:00
let lowQualityImageMode = outer1_17.dataSavingMode;
2026-07-20 16:05:17 +00:00
if (null == lowQualityImageMode) {
2026-07-23 10:11:24 +00:00
lowQualityImageMode = outer1_17.lowQualityImageMode;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
outer1_17.dataSavingMode = lowQualityImageMode;
const hdrDynamicRange = outer1_17.hdrDynamicRange;
2026-07-20 16:05:17 +00:00
let str2 = "no-limit";
if (null != hdrDynamicRange) {
str2 = hdrDynamicRange;
}
2026-07-23 10:11:24 +00:00
outer1_17.hdrDynamicRange = str2;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
UNSET = outer1_8.UNSET;
2026-07-20 16:05:17 +00:00
}
};
const items = [obj, , , , , , , , , , , , , , , , , , , , , , , , , , , , , ];
obj = {
key: "getUserAgnosticState",
value() {
2026-07-23 10:11:24 +00:00
return outer1_17;
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "displayCompactAvatars",
get() {
2026-07-23 10:11:24 +00:00
const displayCompactAvatars = outer1_17.displayCompactAvatars;
2026-07-20 16:05:17 +00:00
return null != displayCompactAvatars && displayCompactAvatars;
}
};
items[2] = obj;
items[3] = {
key: "lowQualityImageMode",
get() {
2026-07-23 10:11:24 +00:00
const lowQualityImageMode = outer1_17.lowQualityImageMode;
2026-07-20 16:05:17 +00:00
return null != lowQualityImageMode && lowQualityImageMode;
}
};
items[4] = {
key: "videoUploadQuality",
get() {
2026-07-23 10:11:24 +00:00
let videoUploadQuality = outer1_17.videoUploadQuality;
2026-07-20 16:05:17 +00:00
if (null == videoUploadQuality) {
2026-07-23 10:11:24 +00:00
videoUploadQuality = outer1_15;
2026-07-20 16:05:17 +00:00
}
return videoUploadQuality;
}
};
items[5] = {
key: "dataSavingMode",
get() {
2026-07-23 10:11:24 +00:00
let lowQualityImageMode = outer1_17.dataSavingMode;
2026-07-20 16:05:17 +00:00
if (null == lowQualityImageMode) {
2026-07-23 10:11:24 +00:00
lowQualityImageMode = outer1_17.lowQualityImageMode;
2026-07-20 16:05:17 +00:00
}
return null != lowQualityImageMode && lowQualityImageMode;
}
};
items[6] = {
key: "expressionPickerWidth",
get() {
2026-07-23 10:11:24 +00:00
let MIN = outer1_17.expressionPickerWidth;
2026-07-20 16:05:17 +00:00
if (null == MIN) {
2026-07-23 10:11:24 +00:00
MIN = outer1_13.MIN;
2026-07-20 16:05:17 +00:00
}
return MIN;
}
};
items[7] = {
key: "messageRequestSidebarWidth",
get() {
2026-07-23 10:11:24 +00:00
let messageRequestSidebarWidth = outer1_17.messageRequestSidebarWidth;
2026-07-20 16:05:17 +00:00
if (null == messageRequestSidebarWidth) {
2026-07-23 10:11:24 +00:00
messageRequestSidebarWidth = outer1_12;
2026-07-20 16:05:17 +00:00
}
return messageRequestSidebarWidth;
}
};
items[8] = {
key: "threadSidebarWidth",
get() {
2026-07-23 10:11:24 +00:00
let threadSidebarWidth = outer1_17.threadSidebarWidth;
2026-07-20 16:05:17 +00:00
if (null == threadSidebarWidth) {
2026-07-23 10:11:24 +00:00
threadSidebarWidth = outer1_10;
2026-07-20 16:05:17 +00:00
}
return threadSidebarWidth;
}
};
items[9] = {
key: "postSidebarWidth",
get() {
2026-07-23 10:11:24 +00:00
let postSidebarWidth = outer1_17.postSidebarWidth;
2026-07-20 16:05:17 +00:00
if (null == postSidebarWidth) {
2026-07-23 10:11:24 +00:00
postSidebarWidth = outer1_14;
2026-07-20 16:05:17 +00:00
}
return postSidebarWidth;
}
};
items[10] = {
key: "callChatSidebarWidth",
get() {
2026-07-23 10:11:24 +00:00
let callChatSidebarWidth = outer1_17.callChatSidebarWidth;
2026-07-20 16:05:17 +00:00
if (null == callChatSidebarWidth) {
2026-07-23 10:11:24 +00:00
callChatSidebarWidth = outer1_10;
2026-07-20 16:05:17 +00:00
}
return callChatSidebarWidth;
}
};
items[11] = {
key: "homeSidebarWidth",
get() {
2026-07-23 10:11:24 +00:00
let homeSidebarWidth = outer1_17.homeSidebarWidth;
2026-07-20 16:05:17 +00:00
if (null == homeSidebarWidth) {
2026-07-23 10:11:24 +00:00
if (null == outer1_16) {
2026-07-20 16:05:17 +00:00
const _Math = Math;
const _window = window;
2026-07-23 10:11:24 +00:00
outer1_16 = Math.max(0.4 * (window.innerWidth - outer1_11), outer1_10);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
homeSidebarWidth = outer1_16;
2026-07-20 16:05:17 +00:00
}
return homeSidebarWidth;
}
};
items[12] = {
key: "callHeaderHeight",
get() {
2026-07-23 10:11:24 +00:00
return outer1_17.callHeaderHeight;
2026-07-20 16:05:17 +00:00
}
};
items[13] = {
key: "useSystemTheme",
get() {
2026-07-23 10:11:24 +00:00
let UNSET = outer1_17.useSystemTheme;
2026-07-20 16:05:17 +00:00
if (null == UNSET) {
2026-07-23 10:11:24 +00:00
UNSET = outer1_8.UNSET;
2026-07-20 16:05:17 +00:00
}
return UNSET;
}
};
items[14] = {
key: "activityPanelHeight",
get() {
2026-07-23 10:11:24 +00:00
return outer1_17.activityPanelHeight;
2026-07-20 16:05:17 +00:00
}
};
items[15] = {
key: "disableVoiceChannelChangeAlert",
get() {
2026-07-23 10:11:24 +00:00
const disableVoiceChannelChangeAlert = outer1_17.disableVoiceChannelChangeAlert;
2026-07-20 16:05:17 +00:00
return null != disableVoiceChannelChangeAlert && disableVoiceChannelChangeAlert;
}
};
items[16] = {
key: "disableHardwareMuteSilenceAlert",
get() {
2026-07-23 10:11:24 +00:00
const disableHardwareMuteSilenceAlert = outer1_17.disableHardwareMuteSilenceAlert;
2026-07-20 16:05:17 +00:00
return null != disableHardwareMuteSilenceAlert && disableHardwareMuteSilenceAlert;
}
};
items[17] = {
key: "disableEmbeddedActivityPopOutAlert",
get() {
2026-07-23 10:11:24 +00:00
const disableEmbeddedActivityPopOutAlert = outer1_17.disableEmbeddedActivityPopOutAlert;
2026-07-20 16:05:17 +00:00
return null != disableEmbeddedActivityPopOutAlert && disableEmbeddedActivityPopOutAlert;
}
};
items[18] = {
key: "disableActivityHardwareAccelerationPrompt",
get() {
2026-07-23 10:11:24 +00:00
const disableActivityHardwareAccelerationPrompt = outer1_17.disableActivityHardwareAccelerationPrompt;
2026-07-20 16:05:17 +00:00
return null != disableActivityHardwareAccelerationPrompt && disableActivityHardwareAccelerationPrompt;
}
};
items[19] = {
key: "disableInviteWithTextChannelActivityLaunch",
get() {
2026-07-23 10:11:24 +00:00
const disableInviteWithTextChannelActivityLaunch = outer1_17.disableInviteWithTextChannelActivityLaunch;
2026-07-20 16:05:17 +00:00
return null != disableInviteWithTextChannelActivityLaunch && disableInviteWithTextChannelActivityLaunch;
}
};
items[20] = {
key: "disableHideSelfStreamAndVideoConfirmationAlert",
get() {
2026-07-23 10:11:24 +00:00
const disableHideSelfStreamAndVideoConfirmationAlert = outer1_17.disableHideSelfStreamAndVideoConfirmationAlert;
2026-07-20 16:05:17 +00:00
return null != disableHideSelfStreamAndVideoConfirmationAlert && disableHideSelfStreamAndVideoConfirmationAlert;
}
};
items[21] = {
key: "pushUpsellUserSettingsDismissed",
get() {
2026-07-23 10:11:24 +00:00
const pushUpsellDismissed = outer1_17.pushUpsellDismissed;
2026-07-20 16:05:17 +00:00
return null != pushUpsellDismissed && pushUpsellDismissed;
}
};
items[22] = {
key: "disableActivityHostLeftNitroUpsell",
get() {
2026-07-23 10:11:24 +00:00
const disableActivityHostLeftNitroUpsell = outer1_17.disableActivityHostLeftNitroUpsell;
2026-07-20 16:05:17 +00:00
return null != disableActivityHostLeftNitroUpsell && disableActivityHostLeftNitroUpsell;
}
};
items[23] = {
key: "disableCallUserConfirmationPrompt",
get() {
2026-07-23 10:11:24 +00:00
const disableCallUserConfirmationPrompt = outer1_17.disableCallUserConfirmationPrompt;
2026-07-20 16:05:17 +00:00
return null != disableCallUserConfirmationPrompt && disableCallUserConfirmationPrompt;
}
};
items[24] = {
key: "disableApplicationSubscriptionCancellationSurvey",
get() {
2026-07-23 10:11:24 +00:00
const disableApplicationSubscriptionCancellationSurvey = outer1_17.disableApplicationSubscriptionCancellationSurvey;
2026-07-20 16:05:17 +00:00
return null != disableApplicationSubscriptionCancellationSurvey && disableApplicationSubscriptionCancellationSurvey;
}
};
items[25] = {
key: "darkSidebar",
get() {
2026-07-23 10:11:24 +00:00
const darkSidebar = outer1_17.darkSidebar;
2026-07-20 16:05:17 +00:00
return null != darkSidebar && darkSidebar;
}
};
items[26] = {
key: "saveCameraUploadsToDevice",
get() {
2026-07-23 10:11:24 +00:00
const saveCameraUploadsToDevice = outer1_17.saveCameraUploadsToDevice;
2026-07-20 16:05:17 +00:00
return null == saveCameraUploadsToDevice || saveCameraUploadsToDevice;
}
};
items[27] = {
key: "isVisualRefreshDisabled",
value(arg0) {
let tmp = arg0;
2026-07-23 10:11:24 +00:00
const disableVisualRefresh = outer1_17.disableVisualRefresh;
2026-07-20 16:05:17 +00:00
if (null != disableVisualRefresh) {
tmp = disableVisualRefresh;
}
return tmp;
}
};
items[28] = {
key: "listDensity",
get() {
2026-07-23 10:11:24 +00:00
let COZY = outer1_17.listDensity;
2026-07-20 16:05:17 +00:00
if (null == COZY) {
2026-07-23 10:11:24 +00:00
COZY = outer1_9.COZY;
2026-07-20 16:05:17 +00:00
}
return COZY;
}
};
items[29] = {
key: "hdrDynamicRange",
get() {
2026-07-23 10:11:24 +00:00
const hdrDynamicRange = outer1_17.hdrDynamicRange;
2026-07-20 16:05:17 +00:00
let str = "no-limit";
if (null != hdrDynamicRange) {
str = hdrDynamicRange;
}
return str;
}
};
return callback(UnsyncedUserSettingsStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").DeviceSettingsStore);
2026-07-20 16:05:17 +00:00
tmp3.displayName = "UnsyncedUserSettingsStore";
tmp3.persistKey = "UnsyncedUserSettingsStore";
2026-07-23 10:11:24 +00:00
let items = [
2026-07-20 16:05:17 +00:00
() => {
2026-07-23 10:11:24 +00:00
const Storage = require(587) /* Storage */.Storage;
2026-07-20 16:05:17 +00:00
const value = Storage.get("UserSettingsStore");
2026-07-23 10:11:24 +00:00
const Storage2 = require(587) /* Storage */.Storage;
2026-07-20 16:05:17 +00:00
Storage2.remove("UserSettingsStore");
2026-07-23 10:11:24 +00:00
return importDefault(22).pick(value, "dataSavingMode", "videoUploadQuality", "lowQualityImageMode", "useSystemTheme", "expressionPickerWidth", "disableVoiceChannelChangeAlert", "disableHardwareMuteSilenceAlert", "disableHideSelfStreamAndVideoConfirmationAlert", "pushUpsellDismissed", "disableEmbeddedActivityPopOutAlert", "disableActivityHardwareAccelerationPrompt", "disableInviteWithTextChannelActivityLaunch", "disableActivityHostLeftNitroUpsell", "disableCallUserConfirmationPrompt", "disableApplicationSubscriptionCancellationSurvey", "enableAndroidChatListAnimations");
2026-07-20 16:05:17 +00:00
},
(arg0) => {
2026-07-23 10:11:24 +00:00
delete tmp.disableVisualRefresh;
2026-07-20 16:05:17 +00:00
}
];
tmp3.migrations = items;
obj = {
UNSYNCED_USER_SETTINGS_UPDATE: function handleUnsyncedUserSettingsUpdate(settings) {
2026-07-23 10:11:24 +00:00
const obj = {};
const merged = Object.assign(obj);
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(settings.settings);
},
LOGOUT: function handleLogOut() {
2026-07-23 10:11:24 +00:00
obj = { useSystemTheme: obj.useSystemTheme };
2026-07-20 16:05:17 +00:00
},
LOGIN_SUCCESS: function handleLogInSuccess() {
if (null == closure_17) {
closure_17 = {};
}
},
REGISTER_SUCCESS: function handleRegisterSuccess() {
closure_17.useSystemTheme = SystemThemeState.ON;
}
};
2026-07-23 10:11:24 +00:00
tmp3 = new tmp3(require("dispatcher"), obj);
let result = require("_possibleConstructorReturn").fileFinishedImporting("modules/user_settings/UnsyncedUserSettingsStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp3;
export const VideoQualitySettings = obj;
export const VideoCompressionQuality = { VERY_LOW: "very_low", LOW: "low", MEDIUM: "medium", HIGH: "high", VERY_HIGH: "very_high" };