decord/source/modules/user_profile/hooks/usePendingAvatarSettings.tsx

71 lines
2.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8408
// Function ID: 8409
2026-07-20 16:05:17 +00:00
// Name: usePendingAvatarSettings
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 8409, 8412, 647, 8413, 8415, 8416, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 8408 (usePendingAvatarSettings)
import set from "set" /* 2 */;
import noop from "noop" /* 19 */;
import closure_4 from "handleFormOpen" /* 8409 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
noop.useCallback;
let result = set.fileFinishedImporting("modules/user_profile/hooks/usePendingAvatarSettings.tsx");
2026-07-20 16:05:17 +00:00
export default function usePendingAvatarSettings(isTryItOut) {
isTryItOut = isTryItOut.isTryItOut;
const guildId = isTryItOut.guildId;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
const tmp2 = guildId(8412)(isTryItOut.analyticsLocations);
2026-07-29 08:29:29 +00:00
dependencyMap = tmp2;
let obj = isTryItOut(647);
2026-08-24 06:08:38 +00:00
const items = [closure_4];
2026-07-20 16:05:17 +00:00
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => {
2026-08-24 06:08:38 +00:00
let obj = closure_1_4;
2026-07-20 16:05:17 +00:00
if (isTryItOut) {
const tryItOutChanges = obj.getTryItOutChanges();
2026-07-29 08:29:29 +00:00
obj = { pendingAvatar: null, pendingAvatarDecoration: null, pendingErrors: null };
({ tryItOutAvatar: obj3[0], tryItOutAvatarDecoration: obj3[1] } = tryItOutChanges);
2026-08-24 06:08:38 +00:00
obj[2] = closure_1_4.getErrors(guildId).avatarDecoration;
2026-07-20 16:05:17 +00:00
return obj;
} else {
const pendingChanges = obj.getPendingChanges(guildId);
2026-07-29 08:29:29 +00:00
obj = { pendingAvatar: null, pendingAvatarDecoration: null, pendingErrors: null };
({ pendingAvatar: obj2[0], pendingAvatarDecoration: obj2[1] } = pendingChanges);
2026-08-24 06:08:38 +00:00
obj[2] = closure_1_4.getErrors(guildId).avatarDecoration;
2026-07-20 16:05:17 +00:00
return obj;
}
});
const items1 = [guildId];
({ pendingAvatar, pendingAvatarDecoration, pendingErrors } = stateFromStoresObject);
let setTryItOutAvatar = useCallback((avatar) => {
2026-08-24 06:08:38 +00:00
let obj = isTryItOut(8413);
2026-07-20 16:05:17 +00:00
obj = { guildId, avatar };
obj.setPendingChanges(obj);
let str = "set";
if (null == avatar) {
str = "remove";
}
2026-08-24 06:08:38 +00:00
const result = isTryItOut(8415).announcePendingAvatarChange(str);
2026-07-20 16:05:17 +00:00
}, items1);
2026-07-29 08:29:29 +00:00
const items2 = [tmp2, guildId];
2026-07-20 16:05:17 +00:00
let setTryItOutAvatarDecoration = useCallback((avatarDecoration) => {
2026-08-24 06:08:38 +00:00
let obj = isTryItOut(8413);
2026-07-20 16:05:17 +00:00
obj = { guildId, avatarDecoration };
obj.setPendingChanges(obj);
if (null != avatarDecoration) {
2026-08-24 06:08:38 +00:00
dependencyMap(avatarDecoration);
2026-07-20 16:05:17 +00:00
}
}, items2);
2026-07-29 08:29:29 +00:00
obj = { pendingAvatar, pendingAvatarDecoration, pendingErrors, setPendingAvatar: null, setPendingAvatarDecoration: null };
2026-07-20 16:05:17 +00:00
if (isTryItOut) {
2026-08-24 06:08:38 +00:00
setTryItOutAvatar = tmp3(8416).setTryItOutAvatar;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = setTryItOutAvatar;
2026-07-20 16:05:17 +00:00
if (isTryItOut) {
2026-08-24 06:08:38 +00:00
setTryItOutAvatarDecoration = tmp3(8416).setTryItOutAvatarDecoration;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[4] = setTryItOutAvatarDecoration;
2026-07-20 16:05:17 +00:00
return obj;
};