70 lines
2.6 KiB
TypeScript
70 lines
2.6 KiB
TypeScript
// Module ID: 8416
|
|
// Function ID: 8417
|
|
// Name: usePendingAvatarSettings
|
|
// Dependencies: [19, 8417, 8420, 647, 8421, 8423, 8424, 2]
|
|
// Exports: default
|
|
|
|
// Module 8416 (usePendingAvatarSettings)
|
|
import set from "set" /* 2 */;
|
|
import noop from "noop" /* 19 */;
|
|
import closure_4 from "handleFormOpen" /* 8417 */;
|
|
|
|
noop.useCallback;
|
|
let result = set.fileFinishedImporting("modules/user_profile/hooks/usePendingAvatarSettings.tsx");
|
|
|
|
export default function usePendingAvatarSettings(isTryItOut) {
|
|
isTryItOut = isTryItOut.isTryItOut;
|
|
const guildId = isTryItOut.guildId;
|
|
dependencyMap = undefined;
|
|
const tmp2 = guildId(8420)(isTryItOut.analyticsLocations);
|
|
dependencyMap = tmp2;
|
|
let obj = isTryItOut(647);
|
|
const items = [closure_4];
|
|
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => {
|
|
let obj = closure_1_4;
|
|
if (isTryItOut) {
|
|
const tryItOutChanges = obj.getTryItOutChanges();
|
|
obj = { pendingAvatar: null, pendingAvatarDecoration: null, pendingErrors: null };
|
|
({ tryItOutAvatar: obj3[0], tryItOutAvatarDecoration: obj3[1] } = tryItOutChanges);
|
|
obj[2] = closure_1_4.getErrors(guildId).avatarDecoration;
|
|
return obj;
|
|
} else {
|
|
const pendingChanges = obj.getPendingChanges(guildId);
|
|
obj = { pendingAvatar: null, pendingAvatarDecoration: null, pendingErrors: null };
|
|
({ pendingAvatar: obj2[0], pendingAvatarDecoration: obj2[1] } = pendingChanges);
|
|
obj[2] = closure_1_4.getErrors(guildId).avatarDecoration;
|
|
return obj;
|
|
}
|
|
});
|
|
const items1 = [guildId];
|
|
({ pendingAvatar, pendingAvatarDecoration, pendingErrors } = stateFromStoresObject);
|
|
let setTryItOutAvatar = useCallback((avatar) => {
|
|
let obj = isTryItOut(8421);
|
|
obj = { guildId, avatar };
|
|
obj.setPendingChanges(obj);
|
|
let str = "set";
|
|
if (null == avatar) {
|
|
str = "remove";
|
|
}
|
|
const result = isTryItOut(8423).announcePendingAvatarChange(str);
|
|
}, items1);
|
|
const items2 = [tmp2, guildId];
|
|
let setTryItOutAvatarDecoration = useCallback((avatarDecoration) => {
|
|
let obj = isTryItOut(8421);
|
|
obj = { guildId, avatarDecoration };
|
|
obj.setPendingChanges(obj);
|
|
if (null != avatarDecoration) {
|
|
dependencyMap(avatarDecoration);
|
|
}
|
|
}, items2);
|
|
obj = { pendingAvatar, pendingAvatarDecoration, pendingErrors, setPendingAvatar: null, setPendingAvatarDecoration: null };
|
|
if (isTryItOut) {
|
|
setTryItOutAvatar = tmp3(8424).setTryItOutAvatar;
|
|
}
|
|
obj[3] = setTryItOutAvatar;
|
|
if (isTryItOut) {
|
|
setTryItOutAvatarDecoration = tmp3(8424).setTryItOutAvatarDecoration;
|
|
}
|
|
obj[4] = setTryItOutAvatarDecoration;
|
|
return obj;
|
|
};
|