Fix long-tapping on items in directories with a lot of items emitting open action on item

Try to reduce the time between selecting files and visual feedback
This commit is contained in:
Mahdi Dibaiee
2015-09-16 19:10:00 +04:30
parent d0c8c91250
commit 31a873d2bb
6 changed files with 32 additions and 22 deletions

View File

@ -39,14 +39,14 @@ const sizes = {
'GB': Math.pow(2, 30),
'MB': Math.pow(2, 20),
'KB': Math.pow(2, 10),
'B': 0
'B': -1
}
export function humanSize(size) {
for (let key in sizes) {
let value = sizes[key];
if (size >= value) {
return Math.round(size / value) + key;
return Math.abs(Math.round(size / value)) + key;
}
}
}