mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-04 21:09:18 -04:00
Account for files that are in bytes
This commit is contained in:
parent
39c719dee6
commit
4838e59daa
1 changed files with 1 additions and 1 deletions
|
@ -139,7 +139,7 @@
|
|||
<script>
|
||||
// Function to convert human-readable sizes back to bytes, for sorting
|
||||
function unhumanize(text) {
|
||||
var powers = {'k': 1, 'm': 2, 'g': 3, 't': 4};
|
||||
var powers = {'b': 0, 'k': 1, 'm': 2, 'g': 3, 't': 4};
|
||||
var regex = /(\d+(?:\.\d+)?)\s?(B|K|M|G|T)?/i;
|
||||
var res = regex.exec(text);
|
||||
if(res[2] === undefined) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue