Merge pull request #5092 from paulkaplan/fix-import-hang

Close importing after failing to import
This commit is contained in:
Paul Kaplan authored and GitHub committed 2019-08-14 11:15:06 -04:00
commit 593c3448eb
1 file changed
+7 -5
+7 -5
View File
@@ -141,11 +141,13 @@ class TargetPane extends React.Component {
this.props.onShowImporting();
handleFileUpload(e.target, (buffer, fileType, fileName, fileIndex, fileCount) => {
spriteUpload(buffer, fileType, fileName, storage, newSprite => {
this.handleNewSprite(newSprite).then(() => {
if (fileIndex === fileCount - 1) {
this.props.onCloseImporting();
}
});
this.handleNewSprite(newSprite)
.then(() => {
if (fileIndex === fileCount - 1) {
this.props.onCloseImporting();
}
})
.catch(this.props.onCloseImporting);
}, this.props.onCloseImporting);
}, this.props.onCloseImporting);
}