Skip to content

Commit

Permalink
refactor: Suggest ErrorBoundary 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
HongBoogie committed Dec 4, 2024
1 parent 3f5d9f9 commit e4ece47
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/src/app/components/cabinet/CabinetContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Broadcast } from '@libs/internalTypes';
import { getSuggestedLiveList } from '@libs/actions';
import useFollowingLives from '@hooks/useFollowingLives';
import useUser from '@hooks/useUser';
import ErrorBoundary from '@components/ErrorBoundary';

const CabinetContainer = () => {
const { isLoggedin } = useUser();
Expand All @@ -18,7 +19,9 @@ const CabinetContainer = () => {
<div className="funch-desktop:pt-16 flex h-full w-full flex-col pt-20">
<CategoryNavigator />
{isLoggedin && <FollowNavigator />}
<SuggestedNavigator />
<ErrorBoundary fallback={null}>
<SuggestedNavigator />
</ErrorBoundary>
</div>
);
};
Expand Down Expand Up @@ -88,7 +91,7 @@ const SuggestedNavigator = () => {
}, []);

const filteredSuggestedList = useMemo(() => {
return suggestedList.filter((suggested) => !ids.includes(suggested.broadcastId));
return suggestedList?.filter((suggested) => !ids.includes(suggested.broadcastId)) || [];
}, [suggestedList, ids]);

return (
Expand Down

0 comments on commit e4ece47

Please sign in to comment.