Skip to content
Snippets Groups Projects
Unverified Commit 71e44dd0 authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge pull request #1612 from paulkaplan/fix-empty-sprite-crash

Allow new sprite to propagate before selecting costume tab
parents 5a4a108e 36a19bfa
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,9 @@ class TargetPane extends React.Component {
const emptyItem = spriteLibraryContent.find(item => item.name === 'Empty');
if (emptyItem) {
this.props.vm.addSprite2(JSON.stringify(emptyItem.json)).then(() => {
this.props.onActivateTab(COSTUMES_TAB_INDEX);
setTimeout(() => { // Wait for targets update to propagate before tab switching
this.props.onActivateTab(COSTUMES_TAB_INDEX);
});
});
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment