diff --git a/gui/preload-chat.js b/gui/preload-chat.js index 33e17fce..ca514ed8 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -2087,17 +2087,15 @@ ipcRenderer.on("update-config", (event, data) => { config = data; }); - - // https://stackoverflow.com/a/18650828 function formatBytes(bytes, decimals = 2) { - if (!+bytes) return '0 Bytes' + if (!+bytes) return "0 Bytes"; - const k = 1024 - const dm = decimals < 0 ? 0 : decimals - const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] + const k = 1024; + const dm = decimals < 0 ? 0 : decimals; + const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; - const i = Math.floor(Math.log(bytes) / Math.log(k)) + const i = Math.floor(Math.log(bytes) / Math.log(k)); - return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}` -} \ No newline at end of file + return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`; +} diff --git a/gui/src/chat-module.html b/gui/src/chat-module.html index 33f1f40a..5f64f0b6 100644 --- a/gui/src/chat-module.html +++ b/gui/src/chat-module.html @@ -626,16 +626,13 @@ > - - -