feat: Redirect users without feature flag from template cred setup (no-changelog) (#8302)

This commit is contained in:
Tomi Turtiainen
2024-01-12 12:10:39 +02:00
committed by GitHub
parent c2748802a2
commit 135553bd6b
10 changed files with 63 additions and 62 deletions

View File

@@ -0,0 +1,12 @@
export const overrideFeatureFlag = (name: string, value: boolean | string) => {
cy.window().then((win) => {
// If feature flags hasn't been initialized yet, we store the override
// in local storage and it gets loaded when the feature flags are
// initialized.
win.localStorage.setItem('N8N_EXPERIMENT_OVERRIDES', JSON.stringify({ [name]: value }));
if (win.featureFlags) {
win.featureFlags.override(name, value);
}
});
};