Skip to content

Commit

Permalink
🐛 serverId 임시 가드
Browse files Browse the repository at this point in the history
  • Loading branch information
yyeonzu committed Dec 1, 2024
1 parent c7ddb8f commit 8cddfe8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/communitysidebar/CommunitySideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ const CommunitySideBar = () => {
const { sideBar, closeSideBar } = useSideBar();
// const { id: serverId } = useLoaderData<{ id: number }>();
const { serverId: id } = useParams<{ serverId: string }>();
if (!id)
throw new Error('CommunityInfoSettingPage: serverId is not provided');
const serverId = parseInt(id, 10);
let serverId = 1;
if (!id) {
serverId = 1;
} else {
serverId = parseInt(id, 10);
}

const { serverInfo, memberList, copyText } = useSideBarData(serverId);
const { isCopied, handleCopy } = useCopyToClipboard(copyText);
const { openDialog } = useDialog();
Expand Down

0 comments on commit 8cddfe8

Please sign in to comment.