From fa76da781872d1a24b9eae02943c86563dcbfe0d Mon Sep 17 00:00:00 2001 From: Will Sheldon <114631109+wssheldon@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:26:10 -0800 Subject: [PATCH] set a global var example --- src/dispatch/static/dispatch/src/main.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/dispatch/static/dispatch/src/main.js b/src/dispatch/static/dispatch/src/main.js index eb035a0fb10e..2fed60e30349 100644 --- a/src/dispatch/static/dispatch/src/main.js +++ b/src/dispatch/static/dispatch/src/main.js @@ -19,10 +19,16 @@ let SENTRY_ENABLED = import.meta.env.VITE_DISPATCH_SENTRY_ENABLED let SENTRY_DSN = import.meta.env.VITE_DISPATCH_SENTRY_DSN let FORMKIT_ENTERPRISE_TOKEN = import.meta.env.FORMKIT_ENTERPRISE_TOKEN +let isUsingFormkitEnterprise = false + if (FORMKIT_ENTERPRISE_TOKEN) { - import("@formkit-enterprise/pro").then((module) => { - // Use the module here - }) + import("@formkit-enterprise/pro") + .then(() => { + isUsingFormkitEnterprise = true + }) + .catch((error) => { + console.error("Error loading @formkit-enterprise/pro", error) + }) } if (SENTRY_ENABLED) { @@ -47,3 +53,5 @@ app.use(router) app.use(store) app.mount("#app") + +export { isUsingFormkitEnterprise }