Skip to content

Commit

Permalink
Initialized array in the right spot
Browse files Browse the repository at this point in the history
  • Loading branch information
silbogdan committed Apr 18, 2021
1 parent 88b950f commit 0d79565
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ export default {
document.getElementById('lcd_display').removeChild(document.getElementById('lcd_display').firstChild);
}
// Create an array for LCD segments simulation
this.lcdComponents = [];
// Create the list needed for the table of components
for (let component of Object.keys(this.projectData.components)) {
let newComponent = {
Expand Down Expand Up @@ -209,8 +212,7 @@ export default {
// Add the component to the table
this.componentsTable.push(newComponent);
// Create the LCD segments simulation and add them to the HTML
this.lcdComponents = [];
// Push the LCD segments simulation to add them to the HTML
if (this.projectData.components[component].name === 'lcd') {
this.lcdComponents.push(component);
}
Expand Down

0 comments on commit 0d79565

Please sign in to comment.