From 253460461658d26c71cedbdb9aa19f71311ed2e4 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Fri, 11 Nov 2022 15:43:02 +0100 Subject: [PATCH] revert base64 encoding before passing file to IPC --- gui/main.js | 2 +- gui/preload-chat.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/main.js b/gui/main.js index 3a628d30..362330ff 100644 --- a/gui/main.js +++ b/gui/main.js @@ -550,7 +550,7 @@ ipcMain.on('save-file-to-folder',(event,data)=>{ try { - let buffer = Buffer.from(atob(data.file)); + let buffer = Buffer.from(data.file); let arraybuffer = Uint8Array.from(buffer); console.log(arraybuffer) fs.writeFile(filepath.filePath, data.file, 'binary', function (err, data) { diff --git a/gui/preload-chat.js b/gui/preload-chat.js index 00112e5a..ec2a6b5e 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -863,7 +863,7 @@ function saveFileToFolder(id) { console.log(data) // we need to encode data because of error "an object could not be cloned" let Data = { - file: btoa(data), + file: data, filename: filename, filetype: filetype, }