Skip to content

Commit

Permalink
fixed a bug in the display of consumption prefs on firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua B. Smith committed Oct 19, 2016
1 parent 0954a4d commit 4740869
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions public/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,19 @@ $(document).ready(function () {
"consumption_preferences_movie_documentary"]);

function addIfAllowedReducer(accumulator, toadd) {
if (consumptionPrefMusic.has(toadd.cpid) && accumulator.reduce(function(k,v) {
return consumptionPrefMusic.has(v.cpid) ? k + 1 : k;
},0) < 1) {
accumulator.push(toadd);
} else if (consumptionPrefMovie.has(toadd.cpid) && accumulator.reduce(function(k,v) {
if (consumptionPrefMusic.has(toadd.cpid)) {
if (accumulator.reduce(function(k,v) {
return consumptionPrefMusic.has(v.cpid) ? k + 1 : k;
},0) < 1) {
accumulator.push(toadd);
}
} else if (consumptionPrefMovie.has(toadd.cpid)) {

if(accumulator.reduce(function(k,v) {
return consumptionPrefMovie.has(v.cpid) ? k + 1 : k;
},0) < 1) {
accumulator.push(toadd);
accumulator.push(toadd);
}
} else {
accumulator.push(toadd);
}
Expand Down

0 comments on commit 4740869

Please sign in to comment.