feat(editor): Add more onboarding options experiment (no-changelog) (#10478)

This commit is contained in:
Milorad FIlipović
2024-08-21 10:37:02 +02:00
committed by GitHub
parent ee7bbbddf2
commit 03c19723d2
6 changed files with 82 additions and 26 deletions

View File

@@ -135,6 +135,7 @@ import {
REPORTED_SOURCE_OTHER,
REPORTED_SOURCE_OTHER_KEY,
VIEWS,
MORE_ONBOARDING_OPTIONS_EXPERIMENT,
} from '@/constants';
import { useToast } from '@/composables/useToast';
import Modal from '@/components/Modal.vue';
@@ -674,9 +675,12 @@ export default defineComponent({
methods: {
closeDialog() {
this.modalBus.emit('close');
const isPartOfOnboardingExperiment =
this.posthogStore.getVariant(MORE_ONBOARDING_OPTIONS_EXPERIMENT.name) ===
MORE_ONBOARDING_OPTIONS_EXPERIMENT.control;
// In case the redirect to homepage for new users didn't happen
// we try again after closing the modal
if (this.$route.name !== VIEWS.HOMEPAGE) {
if (this.$route.name !== VIEWS.HOMEPAGE && !isPartOfOnboardingExperiment) {
void this.$router.replace({ name: VIEWS.HOMEPAGE });
}
},