File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -98,17 +98,11 @@ export default function CodeBlock({ children: rawChildren, ...props }) {
9898 setNames ( contents . map ( elem => elem . split ( '/' ) . pop ( ) . split ( '.' ) [ 0 ] ) ) ;
9999 } else {
100100 const memberContents = await fetchMembers ( 'Code-Study' ) ;
101-
102- const contents = memberContents . map ( async member => {
103- const contents = await getFilesRecursively ( member , 'LeetCode' , props . metastring ) ;
104- const codePromises = contents
105- . filter ( element => element . endsWith ( '.py' ) )
106- . map ( element =>
107- getRepositoryFileContent ( member , 'LeetCode' , element )
108- ) ;
109- const codeContents = await Promise . all ( codePromises ) ;
110- setNames ( ( prevNames ) => [ ...prevNames , ...member ] ) ;
111- setCodes ( ( prevCodes ) => [ ...prevCodes , ...codeContents ] ) ;
101+ const fileName = props . metastring + '/' + props . metastring + '.py'
102+ memberContents . map ( async member => {
103+ const contents = await getRepositoryFileContent ( member , 'LeetCode' , fileName ) ;
104+ setNames ( ( prevNames ) => [ ...prevNames , member ] ) ;
105+ setCodes ( ( prevCodes ) => [ ...prevCodes , contents ] ) ;
112106 } ) ;
113107 }
114108 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments