@@ -888,12 +888,18 @@ async function store(state, emitter) {
888
888
log ( 'upload-files' )
889
889
state . isTransferring = true
890
890
emitter . emit ( 'render' )
891
- // Check if it will overwrite something
891
+
892
+ // Check which files will be overwritten on the board
892
893
const willOverwrite = await checkOverwrite ( {
894
+ source : 'board' ,
893
895
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
+ ) ,
896
901
} )
902
+
897
903
if ( willOverwrite . length > 0 ) {
898
904
let message = `You are about to overwrite the following files/folders on your board:\n\n`
899
905
willOverwrite . forEach ( f => message += `${ f . fileName } \n` )
@@ -906,7 +912,7 @@ async function store(state, emitter) {
906
912
return
907
913
}
908
914
}
909
- // Upload files
915
+
910
916
for ( let i in state . selectedFiles ) {
911
917
const file = state . selectedFiles [ i ]
912
918
const srcPath = disk . getFullPath (
@@ -947,12 +953,18 @@ async function store(state, emitter) {
947
953
log ( 'download-files' )
948
954
state . isTransferring = true
949
955
emitter . emit ( 'render' )
950
- // Check if it will overwrite something
956
+
957
+ // Check which files will be overwritten on the disk
951
958
const willOverwrite = await checkOverwrite ( {
959
+ source : 'disk' ,
952
960
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
+ ) ,
955
966
} )
967
+
956
968
if ( willOverwrite . length > 0 ) {
957
969
let message = `You are about to overwrite the following files/folders on your disk:\n\n`
958
970
willOverwrite . forEach ( f => message += `${ f . fileName } \n` )
@@ -965,7 +977,7 @@ async function store(state, emitter) {
965
977
return
966
978
}
967
979
}
968
- // Download files
980
+
969
981
for ( let i in state . selectedFiles ) {
970
982
const file = state . selectedFiles [ i ]
971
983
const srcPath = serial . getFullPath (
0 commit comments