Skip to content

Commit 169a01a

Browse files
authored
Merge pull request #137 from arduino/bugfix/stuck-in-loading
Stuck in loading files
2 parents f99cba5 + 8192bbf commit 169a01a

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

ui/arduino/store.js

+24-12
Original file line numberDiff line numberDiff line change
@@ -406,24 +406,36 @@ async function store(state, emitter) {
406406
emitter.emit('render')
407407

408408
if (state.isConnected) {
409-
state.boardFiles = await getBoardFiles(
410-
serial.getFullPath(
411-
state.boardNavigationRoot,
412-
state.boardNavigationPath,
413-
''
409+
try {
410+
state.boardFiles = await getBoardFiles(
411+
serial.getFullPath(
412+
state.boardNavigationRoot,
413+
state.boardNavigationPath,
414+
''
415+
)
414416
)
415-
)
417+
} catch (e) {
418+
state.boardFiles = []
419+
}
416420
} else {
417421
state.boardFiles = []
418422
}
419423

420-
state.diskFiles = await getDiskFiles(
421-
disk.getFullPath(
422-
state.diskNavigationRoot,
423-
state.diskNavigationPath,
424-
''
424+
try {
425+
state.diskFiles = await getDiskFiles(
426+
disk.getFullPath(
427+
state.diskNavigationRoot,
428+
state.diskNavigationPath,
429+
''
430+
)
425431
)
426-
)
432+
} catch (e) {
433+
state.diskNavigationRoot = null
434+
state.diskNavigationPath = '/'
435+
state.isLoadingFiles = false
436+
emitter.emit('render')
437+
return
438+
}
427439

428440
emitter.emit('refresh-selected-files')
429441
state.isLoadingFiles = false

0 commit comments

Comments
 (0)