calculate file size for new message

This commit is contained in:
DJ2LS 2022-11-11 14:32:08 +01:00
parent ed31c8da18
commit aaaa0a720f
2 changed files with 10 additions and 2 deletions

View file

@ -474,7 +474,15 @@ update_chat = function(obj) {
var filename = Object.keys(obj._attachments)[0]
var filetype = filename.split('.')[1]
var filesize = obj._attachments[filename]["length"] + " Bytes";
if (filesize == 'undefined Bytes'){
// get filesize of new submitted data
// not that nice....
// we really should avoid converting back from base64 for performance reasons...
var filesize = Math.ceil(atob(obj._attachments[filename]["data"]).length) + "Bytes";
}
var fileheader = `
<div class="card-header border-0 bg-transparent text-end p-0 mb-0 hover-overlay">
<p class="text-right mb-0 p-1 text-black" style="text-align: right; font-size : 1rem">

View file

@ -2240,7 +2240,7 @@ ipcRenderer.on('action-show-arq-toast-transmission-transmitting', (event, data)
document.getElementById('toastARQtransmittingSNRValue').innerHTML = " okay " + irs_snr;
toast.show();
} else if(irs_snr > 5){
} else if(irs_snr > 5 && irs_snr < 12.7){
document.getElementById("toastARQtransmittingSNR").className = "toast align-items-center text-white bg-success border-0";
document.getElementById('toastARQtransmittingSNRValue').innerHTML = " good " + irs_snr;
toast.show();