From 93c26dac286e8fa984cb6fb6fecd6167fc4143f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Thu, 25 Aug 2022 15:11:37 +0200 Subject: [PATCH] fix(editor): Fix feature flag check when PH is unavailable (#3944) :bug: Fix feature flag check when PH is unavailable --- .../editor-ui/src/plugins/telemetry/telemetry.types.ts | 1 + packages/editor-ui/src/views/NodeView.vue | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/editor-ui/src/plugins/telemetry/telemetry.types.ts b/packages/editor-ui/src/plugins/telemetry/telemetry.types.ts index 131f45c1791ba..89be705eb2e6e 100644 --- a/packages/editor-ui/src/plugins/telemetry/telemetry.types.ts +++ b/packages/editor-ui/src/plugins/telemetry/telemetry.types.ts @@ -40,6 +40,7 @@ interface posthog { callback?: Function, ): unknown; }; + getFeatureFlag?: (flagName: string) => boolean; } export interface IUserNodesPanelSession { diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 51e8a27dd7b0a..1c578f55d019f 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -2051,7 +2051,12 @@ export default mixins( this.setZoomLevel(1); - if (window.posthog && !window.featureFlag.isEnabled('show-welcome-note')) return; + if ( + window.posthog && window.featureFlag && window.posthog.getFeatureFlag && + !window.featureFlag.isEnabled('show-welcome-note') + ) { + return; + } setTimeout(() => { this.$store.commit('setNodeViewOffsetPosition', {newOffset: [0, 0]});