Skip to content
Permalink
Browse files

fix: correctly set variant in browser storage when set using query st…

…ring
  • Loading branch information...
danhayden committed Sep 4, 2017
1 parent efb2b0e commit 7131f48996698eb06a89c39797c552d9db456185
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/react-simple-experiment.js
@@ -52,9 +52,10 @@ export class Experiment extends React.Component {
const {data, variantNames} = this.getVariantData()
if (!variant || !variantNames.includes(variant) || data[variant] < 1) {
variant = pickByWeight(data)
storage.setItem(this.storageName, variant)
}
this.activateVariant(variant)
storage.setItem(this.storageName, variant).then(() => {
this.activateVariant(variant)
})
}

activateVariant = variant => {

0 comments on commit 7131f48

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