fix: seeing own profile

This commit is contained in:
Zamitto 2024-10-14 14:42:16 -03:00
parent 034e88e286
commit 359733fa40
2 changed files with 11 additions and 7 deletions

View File

@ -15,8 +15,8 @@ import Color from "color";
const HERO_ANIMATION_THRESHOLD = 25;
interface AchievementsContentProps {
userId: string | null;
displayName: string | null;
otherUserId: string | null;
otherUserDisplayName: string | null;
}
interface AchievementListProps {
@ -201,8 +201,8 @@ function AchievementList({
}
export function AchievementsContent({
userId,
displayName,
otherUserId: userId,
otherUserDisplayName: displayName,
}: AchievementsContentProps) {
const heroRef = useRef<HTMLDivElement | null>(null);
const containerRef = useRef<HTMLDivElement | null>(null);

View File

@ -1,5 +1,5 @@
import { setHeaderTitle } from "@renderer/features";
import { useAppDispatch } from "@renderer/hooks";
import { useAppDispatch, useUserDetails } from "@renderer/hooks";
import type { GameShop } from "@types";
import { useEffect } from "react";
import { useSearchParams } from "react-router-dom";
@ -20,6 +20,8 @@ export function Achievement() {
const userId = searchParams.get("userId");
const displayName = searchParams.get("displayName");
const { userDetails } = useUserDetails();
const dispatch = useAppDispatch();
useEffect(() => {
@ -30,6 +32,8 @@ export function Achievement() {
if (!objectId || !shop || !title) return null;
const otherUserId = userDetails?.id == userId ? null : userId;
return (
<GameDetailsContextProvider
gameTitle={title}
@ -47,8 +51,8 @@ export function Achievement() {
<AchievementsSkeleton />
) : (
<AchievementsContent
userId={userId}
displayName={displayName}
otherUserId={otherUserId}
otherUserDisplayName={displayName}
/>
)}
</SkeletonTheme>