Skip to content

Commit 215c7b5

Browse files
rwblaireffigies
andauthored
Update web/src/App.tsx
Co-authored-by: Chris Markiewicz <markiewicz@stanford.edu>
1 parent 0c4797f commit 215c7b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

web/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ function App() {
5454
const dirHandle = await directoryOpen({
5555
recursive: true,
5656
})
57+
const fileTree = await fileListToTree(dirHandle)
5758
let config = {}
58-
const configFile = dirHandle.find(file => file.name ==='.bids-validator-config.json')
59+
const configFile = fileTree.get('.bids-validator-config.json') as BIDSFile
5960
if (configFile) {
60-
config = configFile.text().then(text => JSON.parse(text)).catch((err) => {
61+
config = await configFile.text().then(text => JSON.parse(text)).catch((err) => {
6162
alert(`Failed to load ".bids-validator-config.json". \n\nUsing empty configuration object:\n\n${err}`)
6263
})
6364
}
64-
const fileTree = await fileListToTree(dirHandle)
6565
setValidation(await validate(fileTree, config))
6666
}
6767

0 commit comments

Comments
 (0)