From e6d5ef50c9ba562a5a4fa9ba29552386b9f6d14b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 24 Oct 2022 09:03:50 +0100 Subject: [PATCH] Remove spam of environment API calls --- packages/client/src/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/client/src/index.js b/packages/client/src/index.js index 80f8754e20..f49e6df5a2 100644 --- a/packages/client/src/index.js +++ b/packages/client/src/index.js @@ -42,17 +42,14 @@ const loadBudibase = async () => { location: window["##BUDIBASE_LOCATION##"], }) - // Reset DND state if we completed a successful drop - // if (get(dndStore).dropped) { - // dndStore.actions.reset() - // } - // Set app ID - this window flag is set by both the preview and the real // server rendered app HTML appStore.actions.setAppId(window["##BUDIBASE_APP_ID##"]) // Fetch environment info - await environmentStore.actions.fetchEnvironment() + if (!get(environmentStore)) { + await environmentStore.actions.fetchEnvironment() + } // Enable dev tools or not. We need to be using a dev app and not inside // the builder preview to enable them.