Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
66 lines
2.9 KiB
TypeScript
66 lines
2.9 KiB
TypeScript
// Module ID: 8276
|
|
// Function ID: 8277
|
|
// Name: usePendingAvatarSettings
|
|
// Dependencies: [19, 8277, 8280, 563, 8281, 8283, 8284, 2]
|
|
// Exports: default
|
|
|
|
// Module 8276 (usePendingAvatarSettings)
|
|
import _mod19 from "module_19" /* 19 */;
|
|
import UserProfileSettingsActionCreators from "UserProfileSettingsActionCreators" /* 8281 */;
|
|
import ProfileCustomizationUtils from "ProfileCustomizationUtils" /* 8283 */;
|
|
import UserProfileSettingsStore from "UserProfileSettingsStore" /* 8277 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
_mod19.useCallback;
|
|
let result = size.fileFinishedImporting("modules/user_profile/hooks/usePendingAvatarSettings.tsx");
|
|
|
|
export default function usePendingAvatarSettings(isTryItOut) {
|
|
isTryItOut = isTryItOut.isTryItOut;
|
|
const guildId = isTryItOut.guildId;
|
|
const tmp2 = guildId(8280)(isTryItOut.analyticsLocations);
|
|
dependencyMap = tmp2;
|
|
const items = [UserProfileSettingsStore];
|
|
const stateFromStoresObject = isTryItOut(563).useStateFromStoresObject(items, () => {
|
|
if (isTryItOut) {
|
|
const tryItOutChanges = obj.getTryItOutChanges();
|
|
const obj5 = { pendingAvatar: null, pendingAvatarDecoration: null, pendingErrors: null };
|
|
({ tryItOutAvatar: obj3.pendingAvatar, tryItOutAvatarDecoration: obj3.pendingAvatarDecoration } = tryItOutChanges);
|
|
obj5.pendingErrors = UserProfileSettingsStore.getErrors(guildId).avatarDecoration;
|
|
return obj5;
|
|
} else {
|
|
const pendingChanges = obj.getPendingChanges(guildId);
|
|
const obj6 = { pendingAvatar: null, pendingAvatarDecoration: null, pendingErrors: null };
|
|
({ pendingAvatar: obj2.pendingAvatar, pendingAvatarDecoration: obj2.pendingAvatarDecoration } = pendingChanges);
|
|
obj6.pendingErrors = UserProfileSettingsStore.getErrors(guildId).avatarDecoration;
|
|
return obj6;
|
|
}
|
|
});
|
|
const items1 = [guildId];
|
|
({ pendingAvatar, pendingAvatarDecoration, pendingErrors } = stateFromStoresObject);
|
|
let setTryItOutAvatar = useCallback((avatar) => {
|
|
UserProfileSettingsActionCreators.setPendingChanges({ guildId, avatar });
|
|
const obj2 = { guildId, avatar };
|
|
let str = "set";
|
|
if (null == avatar) {
|
|
str = "remove";
|
|
}
|
|
const result = ProfileCustomizationUtils.announcePendingAvatarChange(str);
|
|
}, items1);
|
|
const items2 = [tmp2, guildId];
|
|
let setTryItOutAvatarDecoration = useCallback((avatarDecoration) => {
|
|
UserProfileSettingsActionCreators.setPendingChanges({ guildId, avatarDecoration });
|
|
if (null != avatarDecoration) {
|
|
closure_2(avatarDecoration);
|
|
}
|
|
}, items2);
|
|
let obj2 = { pendingAvatar, pendingAvatarDecoration, pendingErrors, setPendingAvatar: null, setPendingAvatarDecoration: null };
|
|
if (isTryItOut) {
|
|
setTryItOutAvatar = tmp3(8284).setTryItOutAvatar;
|
|
}
|
|
obj2.setPendingAvatar = setTryItOutAvatar;
|
|
if (isTryItOut) {
|
|
setTryItOutAvatarDecoration = tmp3(8284).setTryItOutAvatarDecoration;
|
|
}
|
|
obj2.setPendingAvatarDecoration = setTryItOutAvatarDecoration;
|
|
return obj2;
|
|
};
|