Skip to content

Commit

Permalink
fix/#61: 부모의 메인화면 예외 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
yh-project committed Aug 31, 2024
1 parent ea14a74 commit d7ef70d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ssh-web/src/pages/Home/HomeParent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ export const HomeParent = ({ parent }: HomeParentProps) => {
const [records, setRecords] = useState<IChildExpRecord[]>([]);

useEffect(() => {
getChildExpRecords(childrenQuery.data.data[idx].nickname)
.then((res) => setRecords(() => [...res.data]))
.catch((err) => console.log(err));
if (childrenQuery.data.data.length) {
getChildExpRecords(childrenQuery.data.data[idx].nickname)
.then((res) => setRecords(() => [...res.data]))
.catch((err) => console.log(err));
}
}, [idx]);

const nav = useNavigate();
Expand Down

0 comments on commit d7ef70d

Please sign in to comment.