Improve compatibility with old versions

- Remove starting "/sdcard/" from file paths on old Firefox OS versions
- Cache results for faster navigation on old Firefox OS devices
This commit is contained in:
Mahdi Dibaiee
2015-09-15 17:26:07 +04:30
parent 66504df4cb
commit 6e52ca6246
10 changed files with 67 additions and 23 deletions

View File

@ -31,6 +31,10 @@ export function reportError(err) {
store.dispatch(action);
}
export function normalize(path) {
return path.replace(/^\//, '').replace('sdcard/', '');
}
const sizes = {
'GB': Math.pow(2, 30),
'MB': Math.pow(2, 20),