feat files: Show File Size and Directory's sub items count
fix styles: make thin-small 15px instead of 14px (was too small)
This commit is contained in:
@@ -2,21 +2,26 @@ import { CHANGE_DIRECTORY, REFRESH, SETTINGS } from 'actions/types';
|
||||
import listFiles from 'actions/list-files';
|
||||
import { children } from 'api/files';
|
||||
import store from 'store';
|
||||
import { reportError } from 'utils';
|
||||
|
||||
export default function(state = '', action) {
|
||||
if (action.type === CHANGE_DIRECTORY) {
|
||||
children(action.dir).then(files => {
|
||||
store.dispatch(listFiles(files));
|
||||
});
|
||||
changeTo(action.dir);
|
||||
|
||||
return action.dir;
|
||||
}
|
||||
|
||||
if (action.type === REFRESH || action.type === SETTINGS) {
|
||||
children(state).then(files => {
|
||||
store.dispatch(listFiles(files));
|
||||
});
|
||||
changeTo(state);
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
function changeTo(dir) {
|
||||
children(dir, true).then(files => {
|
||||
store.dispatch(listFiles(files));
|
||||
}, reportError);
|
||||
}
|
||||
|
Reference in New Issue
Block a user