Skip to content

Commit

Permalink
Merge pull request #152 from GerFr/LogicFixing
Browse files Browse the repository at this point in the history
small bugfix
  • Loading branch information
GerFr authored Jun 10, 2024
2 parents 1c7e811 + 4da8d54 commit 58fd809
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions warenkorb.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@
let result = maxcolor.filter(item => !set1.has(item.StarID))

//render random product suggestion if more than one element in the suggestion dataset
if(result.length > 1){
const ran = Math.floor(Math.random() * (maxcolor.length-1))
if(result.length > 1){
const ran = Math.floor(Math.random() * (result.length))
var ran2 = ran
while(ran === ran2){
ran2 = Math.floor(Math.random() * (maxcolor.length-1))
ran2 = Math.floor(Math.random() * (result.length))
}
const prod_suggestion = [result[ran], result[ran2]]
render(prod_suggestion, '[type="text/x-handlebars-suggestion"]')
Expand Down

0 comments on commit 58fd809

Please sign in to comment.