Fix directories with nested files not showing

Fix cwd showing "/sdcard/sdcard" directories
This commit is contained in:
Mahdi Dibaiee
2015-09-15 17:57:43 +04:30
parent 6e52ca6246
commit d52fe9f9bc
6 changed files with 14 additions and 16 deletions

View File

@ -5,5 +5,5 @@ export default function changedir(dir) {
return {
type: CHANGE_DIRECTORY,
dir
};
}
}

View File

@ -1,7 +1,7 @@
import { CHANGE_DIRECTORY, REFRESH, SETTINGS } from 'actions/types';
import { children, CACHE } from 'api/files';
import store from 'store';
import { reportError } from 'utils';
import { reportError, normalize } from 'utils';
import { listFiles } from 'actions/files-view';
export default function(state = '', action) {
@ -25,6 +25,7 @@ export default function(state = '', action) {
}
function changeTo(dir) {
dir = normalize(dir);
children(dir, true).then(files => {
store.dispatch(listFiles(files));
}, reportError)