From 05e1dee992d020212cc86dee7cc7ddbce3efccec Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 5 Feb 2024 11:49:43 +0000 Subject: [PATCH] Add missing await and batch some more API calls for speed --- packages/builder/src/stores/builder/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/stores/builder/index.js b/packages/builder/src/stores/builder/index.js index c7e882428e..6cb3743ba6 100644 --- a/packages/builder/src/stores/builder/index.js +++ b/packages/builder/src/stores/builder/index.js @@ -100,11 +100,13 @@ const resetBuilderHistory = () => { export const initialise = async pkg => { const { application } = pkg - appStore.syncAppPackage(pkg) - appStore.syncAppRoutes() + await Promise.all([ + appStore.syncAppRoutes(), + componentStore.refreshDefinitions(application?.appId), + ]) builderStore.init(application) + appStore.syncAppPackage(pkg) navigationStore.syncAppNavigation(application?.navigation) - await componentStore.refreshDefinitions(application?.appId) themeStore.syncAppTheme(application) screenStore.syncAppScreens(pkg) layoutStore.syncAppLayouts(pkg)