feat(editor): switch initial route based on feature flag (#4383)

* feat: switch initial route based on feature flag

* style: change code to optional chaining
This commit is contained in:
Alex Grozav 2022-10-20 13:14:48 +03:00 committed by GitHub
parent 0e044f7684
commit 6d25eed050
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,7 +69,9 @@ const router = new Router({
name: VIEWS.HOMEPAGE,
meta: {
getRedirect(store: Store<IRootState>) {
return { name: VIEWS.WORKFLOWS };
const startOnNewWorkflowRouteFlag = window.posthog?.isFeatureEnabled?.('start-at-wf-empty-state');
return { name: startOnNewWorkflowRouteFlag ? VIEWS.NEW_WORKFLOW : VIEWS.WORKFLOWS };
},
permissions: {
allow: {