Skip to content

Commit

Permalink
Remove performers with no instrument when song is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
parsingphase committed Feb 28, 2017
1 parent 7c1760b commit 1d0eddf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions web/js/ticket.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,16 @@ var ticketer = (function() {
}
);

// Iterate through currentBand and remove any instruments not present in song abbreviations
var validInstruments = song.instruments.map(function(i) {
return i.abbreviation;
});
for (var instrument in currentBand) {
if (validInstruments.indexOf(instrument) === -1) {
currentBand[instrument] = [];
}
}

updateInstrumentTabPerformers();
rebuildPerformerList();
}
Expand Down

0 comments on commit 1d0eddf

Please sign in to comment.