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

103 lines
3 KiB
TypeScript
Raw Normal View History

// Module ID: 8212
// Function ID: 8213
2026-07-20 16:05:17 +00:00
// Name: useDisplayProfile
// Dependencies: [19, 1371, 7635, 504, 8213, 1933, 8215, 2]
2026-07-29 08:29:29 +00:00
// Exports: default, getDisplayProfile, useDisplayProfileWithFetchEffect
2026-07-20 16:05:17 +00:00
// Module 8212 (useDisplayProfile)
import maybeFetchUserProfileDefault from "maybeFetchUserProfile" /* 8213 */;
import DisplayProfileDefault from "DisplayProfile" /* 8215 */;
import noop from "module_19" /* 19 */;
import UserStore from "UserStore" /* 1371 */;
import UserProfileStore from "UserProfileStore" /* 7635 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const require = fn;
const FunctionUtils = fn(1933);
let closure_6 = FunctionUtils.cachedFunction((arg0, arg1) => new DisplayProfileDefault(arg0, arg1));
const size = fn(2);
const result = size.fileFinishedImporting("modules/user_profile/hooks/useDisplayProfile.tsx");
2026-07-29 08:29:29 +00:00
export default function useDisplayProfile(arg0, arg1) {
_require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
const items = [UserStore, UserProfileStore];
return require("initialize").useStateFromStores(items, () => {
2026-07-29 08:29:29 +00:00
let tmp2 = null;
2026-07-23 10:11:24 +00:00
if (null != closure_0) {
const items = [UserStore, UserProfileStore];
2026-07-29 08:29:29 +00:00
[obj, obj2] = items;
let tmp6 = null;
if (null !== tmp) {
const user = obj.getUser(tmp);
const userProfile = obj2.getUserProfile(tmp);
let tmp10 = null;
if (null != user) {
tmp10 = null;
if (null != userProfile) {
tmp10 = closure_6(userProfile, tmp9);
2026-07-29 08:29:29 +00:00
}
}
tmp6 = tmp10;
}
tmp2 = tmp6;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
};
export const useDisplayProfileWithFetchEffect = function useDisplayProfileWithFetchEffect(arg0, guildId) {
2026-07-29 08:29:29 +00:00
_require = arg0;
let items = [guildId, arg0];
const effect = noop.useEffect(() => {
maybeFetchUserProfileDefault(closure_0, undefined, { guildId });
}, items);
closure_129_0 = arg0;
closure_129_1 = guildId;
const items1 = [UserStore, UserProfileStore];
return require("initialize").useStateFromStores(items1, () => {
2026-07-29 08:29:29 +00:00
let tmp2 = null;
if (null != closure_0) {
const items = [UserStore, UserProfileStore];
2026-07-29 08:29:29 +00:00
[obj, obj2] = items;
let tmp6 = null;
if (null !== tmp) {
const user = obj.getUser(tmp);
const userProfile = obj2.getUserProfile(tmp);
let tmp10 = null;
if (null != user) {
tmp10 = null;
if (null != userProfile) {
tmp10 = closure_6(userProfile, tmp9);
2026-07-29 08:29:29 +00:00
}
}
tmp6 = tmp10;
}
tmp2 = tmp6;
}
return tmp2;
});
};
export const getDisplayProfile = function getDisplayProfile(id1, guildId) {
2026-07-20 16:05:17 +00:00
let tmp = arg2;
if (arg2 === undefined) {
const items = [UserStore, UserProfileStore];
2026-07-20 16:05:17 +00:00
tmp = items;
}
[obj, obj2] = tmp;
if (null === id1) {
2026-07-20 16:05:17 +00:00
return null;
} else {
const user = obj.getUser(id1);
const userProfile = obj2.getUserProfile(id1);
2026-07-20 16:05:17 +00:00
let tmp8 = null;
if (null != user) {
tmp8 = null;
if (null != userProfile) {
tmp8 = closure_6(userProfile, tmp7);
2026-07-20 16:05:17 +00:00
}
}
return tmp8;
}
};