Skip to content

Commit ccdf8ab

Browse files
committed
Don't clear folder selection if "open folder" dialog is canceled
1 parent 663390a commit ccdf8ab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ui/arduino/store.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ function store(state, emitter) {
202202
emitter.on('open-folder', async () => {
203203
log('open-folder')
204204
let { folder, files } = await disk.openFolder()
205-
// disk.openFolder() returns *string* 'null' because of `ipc`
206-
folder = folder === 'null' ? null : folder
207-
localStorage.setItem('diskPath', folder)
208-
state.diskPath = folder
209-
state.diskFiles = files
205+
if (folder !== 'null' && folder !== null) {
206+
localStorage.setItem('diskPath', folder)
207+
state.diskPath = folder
208+
state.diskFiles = files
209+
}
210210
if (!state.isFilesOpen) emitter.emit('show-files')
211211
emitter.emit('render')
212212
})

0 commit comments

Comments
 (0)