File tree 1 file changed +5
-11
lines changed
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 }) {
98
98
setNames ( contents . map ( elem => elem . split ( '/' ) . pop ( ) . split ( '.' ) [ 0 ] ) ) ;
99
99
} else {
100
100
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 ] ) ;
112
106
} ) ;
113
107
}
114
108
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments