Fix id for selected item, return when CostumeCanvas draw fails

This commit is contained in:
Tim Mickel committed 2016-10-20 13:44:16 -04:00
1 parent bd22602aa7
commit 9cc4dcf48f
2 files changed
+5 -2

No files matched your search

+3
View File
@@ -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');
+2 -2
View File
@@ -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} />;
});