Skip to content

Commit bf20272

Browse files
committed
Merge branch 'development' into feature/rename-files
2 parents 71285cb + 7c043c7 commit bf20272

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

ui/arduino2/store.js

+20-8
Original file line numberDiff line numberDiff line change
@@ -888,12 +888,18 @@ async function store(state, emitter) {
888888
log('upload-files')
889889
state.isTransferring = true
890890
emitter.emit('render')
891-
// Check if it will overwrite something
891+
892+
// Check which files will be overwritten on the board
892893
const willOverwrite = await checkOverwrite({
894+
source: 'board',
893895
fileNames: state.selectedFiles.map(f => f.fileName),
894-
parentPath: serial.getFullPath(state.boardNavigationRoot, state.boardNavigationPath, ''),
895-
source: 'board'
896+
parentPath: serial.getFullPath(
897+
state.boardNavigationRoot,
898+
state.boardNavigationPath,
899+
''
900+
),
896901
})
902+
897903
if (willOverwrite.length > 0) {
898904
let message = `You are about to overwrite the following files/folders on your board:\n\n`
899905
willOverwrite.forEach(f => message += `${f.fileName}\n`)
@@ -906,7 +912,7 @@ async function store(state, emitter) {
906912
return
907913
}
908914
}
909-
// Upload files
915+
910916
for (let i in state.selectedFiles) {
911917
const file = state.selectedFiles[i]
912918
const srcPath = disk.getFullPath(
@@ -947,12 +953,18 @@ async function store(state, emitter) {
947953
log('download-files')
948954
state.isTransferring = true
949955
emitter.emit('render')
950-
// Check if it will overwrite something
956+
957+
// Check which files will be overwritten on the disk
951958
const willOverwrite = await checkOverwrite({
959+
source: 'disk',
952960
fileNames: state.selectedFiles.map(f => f.fileName),
953-
parentPath: disk.getFullPath(state.diskNavigationRoot, state.diskNavigationPath, ''),
954-
source: 'disk'
961+
parentPath: disk.getFullPath(
962+
state.diskNavigationRoot,
963+
state.diskNavigationPath,
964+
''
965+
),
955966
})
967+
956968
if (willOverwrite.length > 0) {
957969
let message = `You are about to overwrite the following files/folders on your disk:\n\n`
958970
willOverwrite.forEach(f => message += `${f.fileName}\n`)
@@ -965,7 +977,7 @@ async function store(state, emitter) {
965977
return
966978
}
967979
}
968-
// Download files
980+
969981
for (let i in state.selectedFiles) {
970982
const file = state.selectedFiles[i]
971983
const srcPath = serial.getFullPath(

0 commit comments

Comments
 (0)