Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
xnkevinnguyen committed Feb 7, 2020
1 parent d859420 commit 26358b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
3 changes: 1 addition & 2 deletions src/view/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ class App extends React.Component<{}, IState> {

handleDeviceChange = (item?: PivotItem) => {
if (item && item.props && item.props.itemKey) {
this.setState({ currentDevice: item.props.itemKey });

sendMessage(WEBVIEW_MESSAGES.SWITCH_DEVICE, {
active_device: item.props.itemKey,
});
this.setState({ currentDevice: item.props.itemKey });
}
};
}
Expand Down
4 changes: 3 additions & 1 deletion src/view/components/microbit/MicrobitImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ const setupButton = (
};
const setupAllButtons = (eventTriggers: EventTriggers, buttonRefs: Object) => {
for (const [key, ref] of Object.entries(buttonRefs)) {
setupButton(ref.current, eventTriggers, key);
if (ref.current) {
setupButton(ref.current, eventTriggers, key);
}
}
};
const updateAllLeds = (
Expand Down
26 changes: 0 additions & 26 deletions src/view/container/device/__snapshots__/Device.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ exports[`Device component should render correctly 1`] = `
className="sim"
fill="rgba(0,0,0,0)"
height="100%"
id="microbit_svg"
version="1.0"
viewBox="0 0 500 408"
width="100%"
Expand Down Expand Up @@ -1180,7 +1179,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-0-0"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1215,7 +1213,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-1-0"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1250,7 +1247,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-2-0"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1285,7 +1281,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-3-0"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1320,7 +1315,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-4-0"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1355,7 +1349,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-0-1"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1390,7 +1383,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-1-1"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1425,7 +1417,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-2-1"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1460,7 +1451,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-3-1"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1495,7 +1485,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-4-1"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1530,7 +1519,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-0-2"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1565,7 +1553,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-1-2"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1600,7 +1587,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-2-2"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1635,7 +1621,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-3-2"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1670,7 +1655,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-4-2"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1705,7 +1689,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-0-3"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1740,7 +1723,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-1-3"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1775,7 +1757,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-2-3"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1810,7 +1791,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-3-3"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1845,7 +1825,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-4-3"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1880,7 +1859,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-0-4"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1915,7 +1893,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-1-4"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1950,7 +1927,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-2-4"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -1985,7 +1961,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-3-4"
rx={3}
ry={3}
style={
Expand Down Expand Up @@ -2020,7 +1995,6 @@ exports[`Device component should render correctly 1`] = `
<rect
className="sim-led"
height={24}
id="LED-4-4"
rx={3}
ry={3}
style={
Expand Down

0 comments on commit 26358b0

Please sign in to comment.