Trigger legendary activation for mrpiglr
cgen-44701f2fb707476ab12710473464bc4b
This commit is contained in:
parent
f2f9ad0d52
commit
0111b33833
1 changed files with 37 additions and 0 deletions
|
|
@ -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) ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue