Trigger legendary activation for mrpiglr

cgen-44701f2fb707476ab12710473464bc4b
This commit is contained in:
Builder.io 2025-10-05 00:09:07 +00:00
parent f2f9ad0d52
commit 0111b33833

View file

@ -145,6 +145,43 @@ const ProfilePassport = () => {
return;
}
if (
resolvedProfile.username &&
resolvedProfile.username.toLowerCase() === "mrpiglr"
) {
try {
await aethexAchievementService.activateCommunityRewards({
email:
resolvedProfile.email ??
user?.email ??
authProfile?.email ??
undefined,
username: resolvedProfile.username,
});
const refreshedProfile =
(await aethexUserService.getProfileByUsername(
resolvedProfile.username,
)) ??
(resolvedId
? await aethexUserService.getProfileById(resolvedId)
: null);
if (refreshedProfile) {
resolvedProfile = {
...refreshedProfile,
email:
(refreshedProfile as any)?.email ??
resolvedProfile.email ??
null,
} as AethexUserProfile & { email?: string | null };
resolvedId = refreshedProfile.id ?? resolvedId;
}
} catch (error) {
console.warn("Failed to activate legendary passport status", error);
}
}
const viewingSelf =
isSelfRoute ||
(!!user?.id && resolvedId === user.id) ||