diff --git a/src/apis/api/user.ts b/src/apis/api/user.ts index b2f30a5..d104828 100644 --- a/src/apis/api/user.ts +++ b/src/apis/api/user.ts @@ -129,11 +129,7 @@ export const signup = async ( lol: games.lol, pubg: games.pubg, overwatch: games.overwatch, - // valorant: games.valorant, - lostark: '', - maplestory: '', - // rsoAccessToken: '', - // rsoRefreshToken: '', + valorant: games.valorant, }); return null; diff --git a/src/pages/overwatch/Card.tsx b/src/pages/overwatch/Card.tsx index 133f91c..e0b8aba 100644 --- a/src/pages/overwatch/Card.tsx +++ b/src/pages/overwatch/Card.tsx @@ -34,12 +34,12 @@ interface CardProps { name: string; battletag: number; type: string; - tank_tier: string; - tank_rank: string; - damage_tier: string; - damage_rank: string; - support_tier: string; - support_rank: string; + tank_tier: string | 'none'; + tank_rank: string | 'none'; + damage_tier: string | 'none'; + damage_rank: string | 'none'; + support_tier: string | 'none'; + support_rank: string | 'none'; wins: number; losses: number; kills: number; @@ -204,23 +204,35 @@ const Card = ({ item, expired }: CardProps) => { 승률 - - = 50 ? '#d31f45' : '#5383e8', - }} - > - {winRate}% - - ({item.author?.wins}승 {item.author?.losses}패) - + {item.author.wins + item.author.losses === 0 ? ( + + 정보없음 + + ) : ( + + = 50 ? '#d31f45' : '#5383e8', + }} + > + {winRate}% + + ({item.author?.wins}승 {item.author?.losses}패) + + )} K/D - {authorKDTypo} + {item.author.kills + item.author.deaths === 0 ? ( + 정보없음 + ) : ( + + {authorKDTypo} + + )} diff --git a/src/pages/overwatch/CreateCard.tsx b/src/pages/overwatch/CreateCard.tsx index d23c044..6f94479 100644 --- a/src/pages/overwatch/CreateCard.tsx +++ b/src/pages/overwatch/CreateCard.tsx @@ -196,7 +196,7 @@ const CreateCard = () => { setIsNewNicknameCertified(false); dispatch( snackbarActions.OPEN_SNACKBAR({ - message: '입력하신 정보와 일치하는 소환사를 찾을 수 없습니다.', + message: '입력하신 정보와 일치하는 플레이어를 찾을 수 없습니다.', severity: 'error', }), ); diff --git a/src/pages/overwatch/MemberSlot.tsx b/src/pages/overwatch/MemberSlot.tsx index 4125479..4cdc608 100644 --- a/src/pages/overwatch/MemberSlot.tsx +++ b/src/pages/overwatch/MemberSlot.tsx @@ -169,22 +169,36 @@ const MemberSlot = ({ name }: MemberSlotProps) => { 승률 - - = 50 ? '#d31f45' : '#5383e8' }} - > - {winRate}% - - - {memberInfo.wins}승 {memberInfo.losses}패 - - + {memberInfo.wins + memberInfo.losses === 0 ? ( + + + 정보없음 + + + ) : ( + + = 50 ? '#d31f45' : '#5383e8' }} + > + {winRate}% + + + {memberInfo.wins}승 {memberInfo.losses}패 + + + )} K/D - {authorKDTypo} + {memberInfo.kills + memberInfo.deaths === 0 ? ( + 정보없음 + ) : ( + + {authorKDTypo} + + )} diff --git a/src/pages/register/InputLol.tsx b/src/pages/register/InputLol.tsx index 5e64fe2..eadc7f2 100644 --- a/src/pages/register/InputLol.tsx +++ b/src/pages/register/InputLol.tsx @@ -47,6 +47,7 @@ const InputLol = () => { ); const exactNickname = await verifyNickname(nickname.trim()); + await loadHistory(nickname); dispatch( registerActions.SET_GAMES_WITH_ID({ @@ -70,10 +71,6 @@ const InputLol = () => { setNickname(''); setWarning(true); setIsPending(false); - } finally { - if (nickname !== '') { - await loadHistory(nickname); - } } }; diff --git a/src/pages/register/InputOverwatch.tsx b/src/pages/register/InputOverwatch.tsx index b4139e8..21d792f 100644 --- a/src/pages/register/InputOverwatch.tsx +++ b/src/pages/register/InputOverwatch.tsx @@ -48,7 +48,9 @@ const InputOverwatch = () => { }), ); - const isExist = await verifyNickname(nickname.trim()); + await verifyNickname(nickname.trim()); + + await loadHistory(nickname.trim()); dispatch( registerActions.SET_GAMES_WITH_ID({ @@ -72,10 +74,6 @@ const InputOverwatch = () => { setNickname(''); setWarning(true); setIsPending(false); - } finally { - if (nickname !== '') { - await loadHistory(nickname); - } } }; diff --git a/src/pages/register/InputPubg.tsx b/src/pages/register/InputPubg.tsx index e22b236..47b5520 100644 --- a/src/pages/register/InputPubg.tsx +++ b/src/pages/register/InputPubg.tsx @@ -13,7 +13,7 @@ import ToggleButton from '@mui/material/ToggleButton'; import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; import { RootState } from 'store'; -import { getPlatform, loadHistory } from 'apis/api/pubg'; +import { getPlatform, fetchMemberHistory, loadHistory } from 'apis/api/pubg'; import { registerActions } from 'store/register-slice'; import { snackbarActions } from 'store/snackbar-slice'; import { gameList } from 'assets/Games.data'; @@ -59,6 +59,8 @@ const InputPubg = () => { const fetchedPlatform = await getPlatform(nickname.trim()); + await loadHistory(nickname.trim(), fetchedPlatform); + dispatch(snackbarActions.CLOSE_SNACKBAR()); dispatch( @@ -84,10 +86,6 @@ const InputPubg = () => { setPlatform('STEAM'); setWarning(true); setIsPending(false); - } finally { - if (nickname !== '') { - await loadHistory(nickname, platform); - } } };