314 lines
15 KiB
TypeScript
314 lines
15 KiB
TypeScript
/* Metro module 8400; source: modules/user_profile/UserProfileSettingsActionCreators.tsx; dependencies: [1945, 1878, 5189, 5062, 8401, 694, 2] */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import GuildMemberStore from '../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
import UserProfileStore from './UserProfileStore.tsx'; /* Metro dependency 5189 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun66746(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8585:6, offset: 0x01c0802b, size: 150 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/UserProfileSettingsActionCreators.tsx');
|
|
exports.setPendingChanges = setPendingChanges;
|
|
function setPendingChanges(a0) { // fn#66747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8585:238, offset: 0x01c080c1, size: 1681 bytes, params: 2, frame: 26
|
|
var r9;
|
|
var r10;
|
|
var r14;
|
|
var imageUri;
|
|
var avatar;
|
|
var skuId;
|
|
var skuId2;
|
|
var skuId4;
|
|
var r8;
|
|
var banner;
|
|
var accentColor;
|
|
var themeColors;
|
|
var userProfileStoreBinding;
|
|
var object;
|
|
var nickname;
|
|
var value9;
|
|
var displayNameStyles2;
|
|
var pronouns2;
|
|
var value11;
|
|
var value12;
|
|
var avatarDecoration;
|
|
var value14;
|
|
var value15;
|
|
var nameplate;
|
|
var value16;
|
|
var collectibles;
|
|
var value17;
|
|
var profileEffect;
|
|
var value18;
|
|
var profileFrame;
|
|
var value19;
|
|
var bannerOriginalMd5;
|
|
var value21;
|
|
var value22;
|
|
var bio2;
|
|
var value23;
|
|
var moduleValue;
|
|
var guildId2;
|
|
var dispatch;
|
|
var object2;
|
|
const guildId = a0.guildId;
|
|
let value = null;
|
|
const value2 = Object.create(value);
|
|
value2.guildId = 0;
|
|
const value3 = copyDataProperties({}, a0, value2, undefined);
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (value != currentUser) {
|
|
userProfileStoreBinding = UserProfileStore;
|
|
r9 = value == guildId ? userProfileStoreBinding.getUserProfile(currentUser.id) : UserProfileStore.getGuildMemberProfile(currentUser.id,
|
|
|
|
guildId);
|
|
r10 = value != guildId ? GuildMemberStore.getMember(guildId, currentUser.id) : value;
|
|
object = {};
|
|
if ('globalName' in value3) {
|
|
if (value3.globalName === currentUser.globalName) {
|
|
object.pendingGlobalName = undefined;
|
|
} else if (value3.globalName !== '') {
|
|
object.pendingGlobalName = value3.globalName;
|
|
} else if (value === currentUser.globalName) {
|
|
object.pendingGlobalName = undefined;
|
|
} else {
|
|
object.pendingGlobalName = value3.globalName;
|
|
}
|
|
}
|
|
if ('nickname' in value3) {
|
|
nickname = value3.nickname;
|
|
value9 = undefined;
|
|
if (nickname === (value == r10 ? value9 : r10.nick)) {
|
|
object.pendingNickname = value9;
|
|
} else if (value3.nickname !== '') {
|
|
object.pendingNickname = value3.nickname;
|
|
} else if (value === (value == r10 ? value9 : r10.nick)) {
|
|
object.pendingNickname = value9;
|
|
} else {
|
|
object.pendingNickname = value3.nickname;
|
|
}
|
|
}
|
|
if ('displayNameStyles' in value3) {
|
|
displayNameStyles2 = value3.displayNameStyles;
|
|
r14 = value != guildId ? value == r10 ? undefined : r10.displayNameStyles : currentUser.displayNameStyles;
|
|
if ((importDefault(5062) /* metro dependency 5062 */)(value != displayNameStyles2 ? displayNameStyles2 : value,
|
|
|
|
value != r14 ? r14 : value)) {
|
|
object.pendingDisplayNameStyles = undefined;
|
|
} else {
|
|
object.pendingDisplayNameStyles = displayNameStyles2;
|
|
}
|
|
}
|
|
if ('pronouns' in value3) {
|
|
pronouns2 = value3.pronouns;
|
|
value11 = undefined;
|
|
if (pronouns2 === (value == r9 ? value11 : r9.pronouns)) {
|
|
object.pendingPronouns = value11;
|
|
} else {
|
|
object.pendingPronouns = value3.pronouns;
|
|
}
|
|
}
|
|
if ('avatar' in value3) {
|
|
if (value == guildId) {
|
|
if (value != guildId) {
|
|
object.pendingAvatar = value3.avatar;
|
|
} else {
|
|
avatar = value3.avatar;
|
|
imageUri = value == avatar ? undefined : avatar.imageUri;
|
|
avatar = currentUser.avatar;
|
|
if (imageUri === avatar) {
|
|
object.pendingAvatar = undefined;
|
|
} else {
|
|
object.pendingAvatar = value3.avatar;
|
|
}
|
|
}
|
|
} else {
|
|
avatar = value3.avatar;
|
|
value12 = undefined;
|
|
imageUri = value == avatar ? value12 : avatar.imageUri;
|
|
avatar = value == r10 ? value12 : r10.avatar;
|
|
if (imageUri === avatar) {
|
|
object.pendingAvatar = undefined;
|
|
} else if (value != guildId) {
|
|
object.pendingAvatar = value3.avatar;
|
|
} else {
|
|
avatar = value3.avatar;
|
|
imageUri = value == avatar ? undefined : avatar.imageUri;
|
|
avatar = currentUser.avatar;
|
|
if (imageUri === avatar) {
|
|
object.pendingAvatar = undefined;
|
|
} else {
|
|
object.pendingAvatar = value3.avatar;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ('avatarDecoration' in value3) {
|
|
if (value == guildId) {
|
|
if (value != guildId) {
|
|
object.pendingAvatarDecoration = value3.avatarDecoration;
|
|
} else {
|
|
avatarDecoration = value3.avatarDecoration;
|
|
value15 = undefined;
|
|
skuId = value == avatarDecoration ? value15 : avatarDecoration.skuId;
|
|
avatarDecoration = currentUser.avatarDecoration;
|
|
if (skuId === (value == avatarDecoration ? value15 : avatarDecoration.skuId)) {
|
|
object.pendingAvatarDecoration = undefined;
|
|
} else {
|
|
object.pendingAvatarDecoration = value3.avatarDecoration;
|
|
}
|
|
}
|
|
} else {
|
|
avatarDecoration = value3.avatarDecoration;
|
|
value14 = undefined;
|
|
skuId = value == avatarDecoration ? value14 : avatarDecoration.skuId;
|
|
if (value == r10) {
|
|
skuId2 = value14;
|
|
} else {
|
|
avatarDecoration = r10.avatarDecoration;
|
|
skuId2 = value == avatarDecoration ? value14 : avatarDecoration.skuId;
|
|
}
|
|
if (skuId === skuId2) {
|
|
object.pendingAvatarDecoration = undefined;
|
|
} else if (value != guildId) {
|
|
object.pendingAvatarDecoration = value3.avatarDecoration;
|
|
} else {
|
|
avatarDecoration = value3.avatarDecoration;
|
|
value15 = undefined;
|
|
skuId = value == avatarDecoration ? value15 : avatarDecoration.skuId;
|
|
avatarDecoration = currentUser.avatarDecoration;
|
|
if (skuId === (value == avatarDecoration ? value15 : avatarDecoration.skuId)) {
|
|
object.pendingAvatarDecoration = undefined;
|
|
} else {
|
|
object.pendingAvatarDecoration = value3.avatarDecoration;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ('nameplate' in value3) {
|
|
if (value == guildId) {
|
|
if (value != guildId) {
|
|
object.pendingNameplate = value3.nameplate;
|
|
} else {
|
|
nameplate = value3.nameplate;
|
|
value17 = undefined;
|
|
skuId = value == nameplate ? value17 : nameplate.skuId;
|
|
collectibles = currentUser.collectibles;
|
|
if (skuId === (value == collectibles || value == collectibles.nameplate ? value17 : collectibles.nameplate.skuId)) {
|
|
object.pendingNameplate = undefined;
|
|
} else {
|
|
object.pendingNameplate = value3.nameplate;
|
|
}
|
|
}
|
|
} else {
|
|
nameplate = value3.nameplate;
|
|
value16 = undefined;
|
|
skuId = value == nameplate ? value16 : nameplate.skuId;
|
|
if (value == r10) {
|
|
skuId4 = value16;
|
|
} else {
|
|
collectibles = r10.collectibles;
|
|
if (value == collectibles) {
|
|
skuId4 = value16;
|
|
} else {
|
|
nameplate = collectibles.nameplate;
|
|
skuId4 = value == nameplate ? value16 : nameplate.skuId;
|
|
}
|
|
}
|
|
if (skuId === skuId4) {
|
|
object.pendingNameplate = undefined;
|
|
} else if (value != guildId) {
|
|
object.pendingNameplate = value3.nameplate;
|
|
} else {
|
|
nameplate = value3.nameplate;
|
|
value17 = undefined;
|
|
skuId = value == nameplate ? value17 : nameplate.skuId;
|
|
collectibles = currentUser.collectibles;
|
|
if (skuId === (value == collectibles || value == collectibles.nameplate ? value17 : collectibles.nameplate.skuId)) {
|
|
object.pendingNameplate = undefined;
|
|
} else {
|
|
object.pendingNameplate = value3.nameplate;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ('profileEffect' in value3) {
|
|
profileEffect = value3.profileEffect;
|
|
value18 = undefined;
|
|
if ((value == profileEffect ? value18 : profileEffect.skuId) === (value == r9 || value == r9.profileEffect ? value18 : r9.profileEffect.skuId)) {
|
|
object.pendingProfileEffect = value18;
|
|
} else {
|
|
object.pendingProfileEffect = value3.profileEffect;
|
|
}
|
|
}
|
|
if ('profileFrame' in value3) {
|
|
profileFrame = value3.profileFrame;
|
|
value19 = undefined;
|
|
if ((value == profileFrame ? value19 : profileFrame.skuId) === (value == r9 || value == r9.profileFrame ? value19 : r9.profileFrame.skuId)) {
|
|
object.pendingProfileFrame = value19;
|
|
} else {
|
|
object.pendingProfileFrame = value3.profileFrame;
|
|
}
|
|
}
|
|
if ('banner' in value3) {
|
|
banner = value3.banner;
|
|
if ((value != banner ? banner : value) === (value != guildId ? value != (value == r9 ? undefined : r9.banner) ? value == r9 ? undefined : r9.banner : value : value != currentUser.banner ? currentUser.banner : value)) {
|
|
object.pendingBanner = undefined;
|
|
object.pendingBannerOriginalMd5 = undefined;
|
|
} else {
|
|
object.pendingBanner = value3.banner;
|
|
bannerOriginalMd5 = value3.bannerOriginalMd5;
|
|
object.pendingBannerOriginalMd5 = value != bannerOriginalMd5 ? bannerOriginalMd5 : value;
|
|
}
|
|
}
|
|
if ('accentColor' in value3) {
|
|
accentColor = value3.accentColor;
|
|
r8 = value != accentColor ? accentColor : value;
|
|
value21 = undefined;
|
|
accentColor = value == r9 ? value21 : r9.accentColor;
|
|
object.pendingAccentColor = r8 === (value != accentColor ? accentColor : value) ? value21 : r8;
|
|
}
|
|
if ('themeColors' in value3) {
|
|
r10 = value == guildId || value == value3.themeColors || value != value3.themeColors[0] ? value != value3.themeColors ? value3.themeColors : value : value == value3.themeColors[1] ? value : value != value3.themeColors ? value3.themeColors : value;
|
|
value22 = undefined;
|
|
themeColors = value == r9 ? value22 : r9.themeColors;
|
|
if ((importDefault(5062) /* metro dependency 5062 */)(r10, value != themeColors ? themeColors : value)) {
|
|
object.pendingThemeColors = value22;
|
|
} else {
|
|
object.pendingThemeColors = value3.themeColors;
|
|
}
|
|
}
|
|
if ('bio' in value3) {
|
|
bio2 = value3.bio;
|
|
value23 = undefined;
|
|
if (bio2 === (value == r9 ? value23 : r9.bio)) {
|
|
object.pendingBio = value23;
|
|
} else {
|
|
object.pendingBio = value3.bio;
|
|
}
|
|
}
|
|
if ('primaryGuildId' in value3) {
|
|
moduleValue = require(8401) /* metro dependency 8401: GuildTagUtils */;
|
|
guildId2 = moduleValue.getUserPrimaryGuild(currentUser.primaryGuild).guildId;
|
|
if (value3.primaryGuildId === (value != guildId2 ? guildId2 : value)) {
|
|
object.pendingPrimaryGuildId = undefined;
|
|
} else {
|
|
object.pendingPrimaryGuildId = value3.primaryGuildId;
|
|
}
|
|
}
|
|
if ('legacyUsernameDisabled' in value3) {
|
|
object.pendingLegacyUsernameDisabled = value3.legacyUsernameDisabled;
|
|
}
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
dispatch = value.dispatch;
|
|
object2 = {type: 'USER_PROFILE_SETTINGS_SET_PENDING_CHANGES', guildId: guildId};
|
|
copyDataProperties(object2, object, value2);
|
|
Reflect.apply(dispatch, value, [object2]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun66746, 8400, [1945, 1878, 5189, 5062, 8401, 694,
|
|
2]) /* metro module 8400, dependencies: [1945, 1878, 5189, 5062, 8401, 694, 2] */;
|