Skip to content

Commit

Permalink
fix: make vendor randomly selected in marketplace
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored and zdtsw committed Jul 1, 2022
1 parent e53e1ce commit 8051115
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/VendorSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import * as React from "react"
import vendors from '../../json/marketplace.json';
import './VendorSelector.scss';

// Shuffle vendors
for (let i = vendors.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[vendors[i], vendors[j]] = [vendors[j], vendors[i]];
}

const VendorSelector = ({
checkboxRef,
setCheckbox
Expand Down

0 comments on commit 8051115

Please sign in to comment.