Skip to content

Commit 2da943e

Browse files
committed
Removed some redundancy, left commented methods for reference.
Signed-off-by: ubi de feo <[email protected]>
1 parent 153e575 commit 2da943e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

preload.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ const Serial = {
5353
const output = await board.fs_cat(file)
5454
return output || ''
5555
},
56-
loadFileBytes: async (file) => {
57-
const output = await board.fs_cat_bytes(file)
58-
return output || ''
59-
},
6056
removeFile: async (file) => {
6157
return board.fs_rm(file)
6258
},
@@ -67,7 +63,7 @@ const Serial = {
6763
return board.fs_put(src, dest, dataConsumer)
6864
},
6965
downloadFile: async (src, dest) => {
70-
let contents = await Serial.loadFileBytes(src)
66+
let contents = await Serial.loadFile(src)
7167
return ipcRenderer.invoke('save-file', dest, contents)
7268
},
7369
renameFile: async (oldName, newName) => {

ui/arduino/store.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,11 +1090,12 @@ async function store(state, emitter) {
10901090
selectedFile.fileName
10911091
)
10921092
)
1093+
const bytesToSource = String.fromCharCode.apply(null, fileContent);
10931094
file = createFile({
10941095
parentFolder: state.boardNavigationPath,
10951096
fileName: selectedFile.fileName,
10961097
source: selectedFile.source,
1097-
content: fileContent
1098+
content: bytesToSource
10981099
})
10991100
file.editor.onChange = function() {
11001101
file.hasChanges = true

0 commit comments

Comments
 (0)