215 lines
8.8 KiB
TypeScript
215 lines
8.8 KiB
TypeScript
/* Metro module 1311; source: modules/user_settings/SelectivelySyncedUserSettingsStore.tsx; dependencies: [6, 7, 15, 17, 18, 661, 566, 587, 22, 694, 2] */
|
|
function _fun14463(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#14463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1438:6, offset: 0x00e07797, size: 343 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const env0_8 = (require(661) /* metro dependency 661: Constants */).UserSettingsSections;
|
|
let env0_9 = {};
|
|
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
|
|
let value = _fun14467(PersistedStore);
|
|
value.displayName = 'SelectivelySyncedUserSettingsStore';
|
|
value.persistKey = 'SelectivelySyncedUserSettingsStore';
|
|
value.migrations = [_fun14474, _fun14475];
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{SELECTIVELY_SYNCED_USER_SETTINGS_UPDATE: SELECTIVELY_SYNCED_USER_SETTINGS_UPDATE, LOGOUT: function() {
|
|
env0_9 = {};
|
|
}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_settings/SelectivelySyncedUserSettingsStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_14464() { // fn#14464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1438:179, offset: 0x00e078ee, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_14464_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun14467(a0) { // fn#14467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1438:387, offset: 0x00e0794c, size: 164 bytes, params: 2, frame: 16
|
|
const closure = SelectivelySyncedUserSettingsStore;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'initialize', value: value_14469}, {key: 'getState', value: value_14470},
|
|
{key: 'shouldSync', value: value_14471}, {key: 'getTextSettings', value: value_14472},
|
|
{key: 'getAppearanceSettings', value: value_14473}]);
|
|
}
|
|
|
|
function _fun14474() { // fn#14474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1438:1286, offset: 0x00e07ae6, size: 296 bytes, params: 1, frame: 19
|
|
var object4;
|
|
var object5;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
const r6 = Storage.get('UserSettingsSync') ?? ({});
|
|
const r5 = Storage.get('UserSettingsStore') ?? ({});
|
|
Storage.remove('UserSettingsSync');
|
|
const object6 = {};
|
|
const TEXT = UserSettingsSections.TEXT;
|
|
if (r6[TEXT] === false) {
|
|
object4 = {shouldSync: false};
|
|
object4.settings = (importDefault(22) /* metro dependency 22 */).pick(r5, ['inlineAttachmentMedia',
|
|
'inlineEmbedMedia', 'renderEmbeds', 'renderReactions', 'animateEmoji', 'animateStickers', 'gifAutoPlay',
|
|
'defaultReactionEmoji']);
|
|
object6.text = object4;
|
|
}
|
|
const APPEARANCE = UserSettingsSections.APPEARANCE;
|
|
if (r6[APPEARANCE] === false) {
|
|
object5 = {shouldSync: false};
|
|
object5.settings = (importDefault(22) /* metro dependency 22 */).pick(r5, ['theme', 'clientThemeSettings',
|
|
'developerMode']);
|
|
object6.appearance = object5;
|
|
}
|
|
return object6;
|
|
}
|
|
|
|
function _fun14475(a0) { // fn#14475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1438:1815, offset: 0x00e07c0e, size: 145 bytes, params: 2, frame: 15
|
|
var r5;
|
|
var theme;
|
|
var appearance;
|
|
var value2;
|
|
var settings;
|
|
var object4;
|
|
var object5;
|
|
var object6;
|
|
const value = undefined;
|
|
if (a0 == null) {
|
|
theme = value;
|
|
} else {
|
|
appearance = a0.appearance;
|
|
value2 = appearance == null;
|
|
if (value2) {
|
|
theme = value;
|
|
r5 = value2;
|
|
} else {
|
|
settings = appearance.settings;
|
|
if (settings == null) {
|
|
theme = value;
|
|
r5 = value2;
|
|
} else {
|
|
theme = settings.theme;
|
|
r5 = value2;
|
|
}
|
|
}
|
|
}
|
|
if (theme === 'amoled') {
|
|
object4 = {};
|
|
copyDataProperties(object4, a0, r5);
|
|
object5 = {};
|
|
appearance = a0.appearance;
|
|
copyDataProperties(object5, appearance, r5);
|
|
object6 = {};
|
|
appearance = a0.appearance;
|
|
copyDataProperties(object6, appearance.settings, r5);
|
|
object6['theme'] = 'midnight';
|
|
object5['settings'] = object6;
|
|
object4['appearance'] = object5;
|
|
return object4;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function SELECTIVELY_SYNCED_USER_SETTINGS_UPDATE({changes}) { // fn#14476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1438:2068, offset: 0x00e07c9f, size: 192 bytes, params: 2, frame: 22
|
|
var r15;
|
|
var shouldSync;
|
|
var r3;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var property;
|
|
var settings;
|
|
var binding;
|
|
var properties4;
|
|
var properties5;
|
|
var properties6;
|
|
var propertyName3;
|
|
var propertyName4;
|
|
var settings2;
|
|
for (propertyName in changes) {
|
|
property = changes[propertyName];
|
|
shouldSync = property.shouldSync;
|
|
settings = property.settings;
|
|
if (shouldSync !== true) {
|
|
if (shouldSync !== false) {
|
|
continue;
|
|
}
|
|
binding = env0_9;
|
|
binding[propertyName] = {shouldSync: shouldSync, settings: {}};
|
|
property = env0_9[propertyName];
|
|
if (property == null) {
|
|
shouldSync = undefined;
|
|
continue;
|
|
}
|
|
shouldSync = property.shouldSync;
|
|
if (shouldSync !== false) {
|
|
r15 = propertyName2;
|
|
continue;
|
|
}
|
|
properties4 = Object.keys(settings);
|
|
properties5 = 0;
|
|
properties6 = properties4.length;
|
|
if (properties4 === undefined) {
|
|
r15 = propertyName2;
|
|
continue;
|
|
}
|
|
for (r3 = properties5; true; r3 = propertyName4) {
|
|
propertyName3 = properties4[r3];
|
|
propertyName4 = r3 + 1;
|
|
if (propertyName3 === undefined) {
|
|
r15 = propertyName2;
|
|
break;
|
|
}
|
|
settings2 = env0_9[propertyName].settings;
|
|
settings2[propertyName3] = settings[propertyName3];
|
|
}
|
|
} else {
|
|
delete env0_9[propertyName];
|
|
r15 = propertyName2;
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_14469(a0) { // fn#14469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1438:787, offset: 0x00e07a61, size: 22 bytes, params: 2, frame: 2
|
|
const r1 = a0 ?? ({});
|
|
value = environment.__proto__;
|
|
}
|
|
|
|
function value_14471(a0) { // fn#14471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1438:884, offset: 0x00e07a80, size: 39 bytes, params: 2, frame: 3
|
|
const value = environment.__proto__;
|
|
return env1_9[a0]?.shouldSync !== false;
|
|
}
|
|
|
|
function value_14472() { // fn#14472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1438:981, offset: 0x00e07aa7, size: 31 bytes, params: 1, frame: 3
|
|
const value = environment.__proto__;
|
|
return env1_9.text?.settings;
|
|
}
|
|
|
|
function value_14473() { // fn#14473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1438:1077, offset: 0x00e07ac6, size: 32 bytes, params: 1, frame: 3
|
|
const value = environment.__proto__;
|
|
return env1_9.appearance?.settings;
|
|
}
|
|
|