Fix id for selected item, return when CostumeCanvas draw fails
This commit is contained in:
2 files changed
+5
-2
No files matched your search
@@ -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} />;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user