FileList
Summary: _typescript_ Reviewed By: danielbuechele Differential Revision: D17180529 fbshipit-source-id: 50258a17c34177317397af618b43f2d2f76fb3a2
This commit is contained in:
committed by
Facebook Github Bot
parent
2d83de99c5
commit
8ae170c034
@@ -83,7 +83,7 @@ export default class FileList extends Component<FileListProps, FileListState> {
|
|||||||
fetchFiles(callback?: Function) {
|
fetchFiles(callback?: Function) {
|
||||||
const {src} = this.props;
|
const {src} = this.props;
|
||||||
|
|
||||||
const setState = data => {
|
const setState = (data: FileListState) => {
|
||||||
if (!hasChangedDir()) {
|
if (!hasChangedDir()) {
|
||||||
this.setState(data);
|
this.setState(data);
|
||||||
}
|
}
|
||||||
@@ -112,14 +112,16 @@ export default class FileList extends Component<FileListProps, FileListState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const name = files.shift();
|
const name = files.shift();
|
||||||
this.fetchFile(name)
|
if (name) {
|
||||||
.then(data => {
|
this.fetchFile(name)
|
||||||
filesSet.set(name, data);
|
.then(data => {
|
||||||
next();
|
filesSet.set(name, data);
|
||||||
})
|
next();
|
||||||
.catch(err => {
|
})
|
||||||
setState({error: err, files: EMPTY_MAP});
|
.catch(err => {
|
||||||
});
|
setState({error: err, files: EMPTY_MAP});
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
next();
|
next();
|
||||||
|
|||||||
Reference in New Issue
Block a user