mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
fix: seeing own profile
This commit is contained in:
parent
034e88e286
commit
359733fa40
@ -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);
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user