mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-10 20:25:34 +00:00
updated default config values
This commit is contained in:
@@ -408,7 +408,7 @@ module.exports.empty = function(state, emit) {
|
||||
}}"
|
||||
>
|
||||
${state.translate('signInSizeBump', {
|
||||
size: bytes(state.LIMITS.MAX_FILE_SIZE, 0)
|
||||
size: bytes(state.LIMITS.MAX_FILE_SIZE)
|
||||
})}
|
||||
</button>
|
||||
`;
|
||||
@@ -445,11 +445,11 @@ module.exports.empty = function(state, emit) {
|
||||
role="button"
|
||||
class="btn rounded-lg flex items-center mt-4"
|
||||
title="${state.translate('addFilesButtonWithSize', {
|
||||
size: bytes(state.user.maxSize, 0)
|
||||
size: bytes(state.user.maxSize)
|
||||
})}"
|
||||
>
|
||||
${state.translate('addFilesButtonWithSize', {
|
||||
size: bytes(state.user.maxSize, 0)
|
||||
size: bytes(state.user.maxSize)
|
||||
})}
|
||||
</label>
|
||||
${upsell}
|
||||
|
||||
@@ -57,13 +57,15 @@ const LOCALIZE_NUMBERS = !!(
|
||||
);
|
||||
|
||||
const UNITS = ['B', 'kB', 'MB', 'GB'];
|
||||
function bytes(num, decimalDigits = 1) {
|
||||
function bytes(num) {
|
||||
if (num < 1) {
|
||||
return '0B';
|
||||
}
|
||||
const exponent = Math.min(Math.floor(Math.log10(num) / 3), UNITS.length - 1);
|
||||
const n = Number(num / Math.pow(1024, exponent));
|
||||
let nStr = n.toFixed(1);
|
||||
const decimalDigits = Math.floor(n) === n ? 0 : 1;
|
||||
console.log(n, decimalDigits);
|
||||
let nStr = n.toFixed(decimalDigits);
|
||||
if (LOCALIZE_NUMBERS) {
|
||||
try {
|
||||
const locale = document.querySelector('html').lang;
|
||||
|
||||
Reference in New Issue
Block a user