From 299a417ac4f1de034e9c84daaffbcf90a91d1ad0 Mon Sep 17 00:00:00 2001 From: Seongjun Jang Date: Fri, 15 Nov 2024 20:26:24 +0900 Subject: [PATCH] [Fix] align name with code --- src/theme/CodeBlock/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/CodeBlock/index.js b/src/theme/CodeBlock/index.js index 80f45a4..dd76017 100644 --- a/src/theme/CodeBlock/index.js +++ b/src/theme/CodeBlock/index.js @@ -99,7 +99,6 @@ export default function CodeBlock({ children: rawChildren, ...props }) { } else { const memberContents = await fetchMembers('Code-Study'); - setNames(memberContents); const contents = memberContents.map(async member => { const contents = await getFilesRecursively(member, 'LeetCode', props.metastring); const codePromises = contents @@ -108,6 +107,7 @@ export default function CodeBlock({ children: rawChildren, ...props }) { getRepositoryFileContent(member, 'LeetCode', element) ); const codeContents = await Promise.all(codePromises); + setNames((prevNames) => [...prevNames, ...member]); setCodes((prevCodes) => [...prevCodes, ...codeContents]); }); }