Skip to content
Permalink
Browse files

fix: select new variant if one returned from storage has weight of 0

  • Loading branch information...
danhayden committed Jul 25, 2017
1 parent 45f6fd0 commit c0522ae0cb93d6f439ff18fd670bf4e0b1268b30
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/react-simple-experiment.js
@@ -30,7 +30,7 @@ export class Experiment extends React.Component {
})

storage.getItem(storageName).then(variant => {
if (!variant || !variantNames.includes(variant)) {
if (!variant || !variantNames.includes(variant) || data[variant] < 1) {
variant = pickOneByWeight(data)
storage.setItem(storageName, variant)
}

0 comments on commit c0522ae

Please sign in to comment.
You can’t perform that action at this time.