set loaded image as new user image

This commit is contained in:
DJ2LS 2023-02-26 09:18:13 +01:00
parent cceee2d8c4
commit a47b0bbfb0

View file

@ -518,6 +518,18 @@ ipcRenderer.on("return-select-user-image", (event, arg) => {
); // smaller than maxSizeMB
console.log(compressedFile.size);
blobUtil.blobToBase64String(compressedFile).then(function (base64String) {
// update image
document.getElementById('userImage').src = 'data:' + imageFiletype + ';base64,' + base64String;
//TODO: add image to user database
}).catch(function (err) {
document.getElementById('userImage').src = "img/icon.png";
});
})
.catch(function (error) {
console.log(error.message);