Skip to content

Commit

Permalink
Few Quick Fixes for PostHog A/B Testing (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantgillespie committed Aug 28, 2024
1 parent df62e27 commit 091cc18
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions components/Block/Tier.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ const { data: block } = useAsyncData(props.uuid, () =>
<BaseBadge color="primary-reverse">{{ block.badge }}</BaseBadge>
</div>
<div class="content">
<h3>{{ block.name }}</h3>
<h3 v-if="block.name">{{ block.name }}</h3>
<small v-if="block.subtext">{{ block.subtext }}&nbsp;</small>
<p class="price">
<span class="value">{{ block.price }}</span>
<p v-if="block.price || block.term" class="price">
<span v-if="block.price" class="value">{{ block.price }}</span>
<br />
<span class="term">{{ block.term }}&nbsp;</span>
<span v-if="block.term" class="term">{{ block.term }}&nbsp;</span>
<span v-if="block.term_tooltip" v-tooltip="block.term_tooltip" class="info">
<BaseIcon size="small" name="info" />
</span>
Expand Down
9 changes: 8 additions & 1 deletion pages/[...permalink].vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,14 @@ const sections = computed(() => {
if (block.experiment && block.experiment_variant) {
const featureFlag = getFeatureFlag(block.experiment.feature_flag);
addBlock = featureFlag.value === block.experiment_variant.key;
if (!featureFlag.value) {
// PostHog is blocked or unavailable, show the control variant
addBlock = block.experiment_variant.key === 'control';
} else {
// PostHog is available, use the returned value
addBlock = featureFlag.value === block.experiment_variant.key;
}
}
// If the block should not be added, skip to the next iteration
Expand Down

0 comments on commit 091cc18

Please sign in to comment.