From ca9d07b535c71e19cfb4331e8abef98ac6411978 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 2 Feb 2024 18:14:46 +0100 Subject: [PATCH] add license check to dev mode for flows --- frontend/src/lib/components/Dev.svelte | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/Dev.svelte b/frontend/src/lib/components/Dev.svelte index d97267f650..3f92e9a613 100644 --- a/frontend/src/lib/components/Dev.svelte +++ b/frontend/src/lib/components/Dev.svelte @@ -11,10 +11,11 @@ OpenAPI, Preview, type OpenFlow, - type FlowModule + type FlowModule, + SettingsService } from '$lib/gen' import { inferArgs } from '$lib/infer' - import { userStore, workspaceStore } from '$lib/stores' + import { enterpriseLicense, userStore, workspaceStore } from '$lib/stores' import { emptySchema, getModifierKey, sendUserToast } from '$lib/utils' import { Pane, Splitpanes } from 'svelte-splitpanes' import { onDestroy, onMount, setContext } from 'svelte' @@ -126,7 +127,13 @@ } } + async function setEnterpriseLicense() { + if (!$enterpriseLicense) { + $enterpriseLicense = await SettingsService.getLicenseId() + } + } onMount(() => { + setEnterpriseLicense() window.addEventListener('message', el, false) document.addEventListener('keydown', (e) => { const obj = {