Skip to content
Snippets Groups Projects
Unverified Commit 9cc4dcf4 authored by Tim Mickel's avatar Tim Mickel
Browse files

Fix id for selected item, return when CostumeCanvas draw fails

parent bd22602a
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,9 @@ class CostumeCanvas extends React.Component {
}
}
draw () {
if (!this.refs.costumeCanvas) {
return;
}
// Draw the costume to the rendered canvas.
const img = this.img;
const context = this.refs.costumeCanvas.getContext('2d');
......
......@@ -28,8 +28,8 @@ class LibraryComponent extends React.Component {
return <LibraryItem
name={dataItem.name}
iconURL={scratchURL}
key={'item_' + itemId}
selected={this.state.selectedItem == itemId}
key={'item_' + id}
selected={this.state.selectedItem == id}
onSelect={this.onSelect}
id={id} />;
});
......
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