Skip to content

Commit 593c344

Browse files
authored
Merge pull request scratchfoundation#5092 from paulkaplan/fix-import-hang
Close importing after failing to import
2 parents 0913c11 + ab0ee83 commit 593c344

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/containers/target-pane.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,13 @@ class TargetPane extends React.Component {
141141
this.props.onShowImporting();
142142
handleFileUpload(e.target, (buffer, fileType, fileName, fileIndex, fileCount) => {
143143
spriteUpload(buffer, fileType, fileName, storage, newSprite => {
144-
this.handleNewSprite(newSprite).then(() => {
145-
if (fileIndex === fileCount - 1) {
146-
this.props.onCloseImporting();
147-
}
148-
});
144+
this.handleNewSprite(newSprite)
145+
.then(() => {
146+
if (fileIndex === fileCount - 1) {
147+
this.props.onCloseImporting();
148+
}
149+
})
150+
.catch(this.props.onCloseImporting);
149151
}, this.props.onCloseImporting);
150152
}, this.props.onCloseImporting);
151153
}

0 commit comments

Comments
 (0)