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) {
|
||||
const {src} = this.props;
|
||||
|
||||
const setState = data => {
|
||||
const setState = (data: FileListState) => {
|
||||
if (!hasChangedDir()) {
|
||||
this.setState(data);
|
||||
}
|
||||
@@ -112,14 +112,16 @@ export default class FileList extends Component<FileListProps, FileListState> {
|
||||
}
|
||||
|
||||
const name = files.shift();
|
||||
this.fetchFile(name)
|
||||
.then(data => {
|
||||
filesSet.set(name, data);
|
||||
next();
|
||||
})
|
||||
.catch(err => {
|
||||
setState({error: err, files: EMPTY_MAP});
|
||||
});
|
||||
if (name) {
|
||||
this.fetchFile(name)
|
||||
.then(data => {
|
||||
filesSet.set(name, data);
|
||||
next();
|
||||
})
|
||||
.catch(err => {
|
||||
setState({error: err, files: EMPTY_MAP});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user