decord/source/modules/game_relationships/hooks/useUserProfileGameFriendApplicationIds.tsx

45 lines
1.6 KiB
TypeScript
Raw Normal View History

// Module ID: 13096
// Function ID: 13097
2026-07-20 16:05:17 +00:00
// Name: useUserProfileGameFriendApplicationIds
// Dependencies: [19, 4222, 1371, 504, 13093, 2]
2026-07-20 16:05:17 +00:00
// Exports: useUserProfileGameFriendApplicationIds
// Module 13096 (useUserProfileGameFriendApplicationIds)
import noop from "module_19" /* 19 */;
import RelationshipStore from "RelationshipStore" /* 4222 */;
import UserStore from "UserStore" /* 1371 */;
2026-07-23 10:11:24 +00:00
const require = fn;
2026-07-20 16:05:17 +00:00
let closure_5 = [];
const size = fn(2);
const result = size.fileFinishedImporting("modules/game_relationships/hooks/useUserProfileGameFriendApplicationIds.tsx");
2026-07-20 16:05:17 +00:00
export const useUserProfileGameFriendApplicationIds = function useUserProfileGameFriendApplicationIds(userId) {
userId = userId.userId;
2026-07-29 08:29:29 +00:00
let stateFromStores;
const items = [RelationshipStore, UserStore];
2026-07-23 10:11:24 +00:00
stateFromStores = userId(stateFromStores[3]).useStateFromStores(items, () => {
let isFriendResult = RelationshipStore.isFriend(userId);
2026-07-20 16:05:17 +00:00
if (!isFriendResult) {
const user = UserStore.getUser(userId);
2026-07-20 16:05:17 +00:00
let isProvisional;
2026-07-29 08:29:29 +00:00
if (user != null) {
2026-07-20 16:05:17 +00:00
isProvisional = user.isProvisional;
}
isFriendResult = isProvisional;
}
return isFriendResult;
});
2026-07-23 10:11:24 +00:00
const obj = userId(stateFromStores[3]);
const gameFriendsForUser = userId(stateFromStores[4]).useGameFriendsForUser(userId);
2026-07-20 16:05:17 +00:00
const items1 = [gameFriendsForUser, stateFromStores];
2026-07-23 10:11:24 +00:00
return gameFriendsForUser.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (stateFromStores) {
let mapped = closure_5;
2026-07-20 16:05:17 +00:00
} else {
mapped = gameFriendsForUser.map((applicationId) => applicationId.applicationId);
}
return mapped;
}, items1);
};