From 14003d03dfc7d10b3b2c29be15a5d37bf17d3253 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 9 Nov 2020 15:55:36 +0000 Subject: [PATCH] fix auto screens issue --- packages/builder/src/builderStore/store/frontend.js | 10 +++++----- .../TableNavigator/modals/CreateTableModal.svelte | 11 +---------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 479d71230d..54725503b9 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -234,12 +234,12 @@ export const getFrontendStore = () => { }, }, preview: { - // _saveCurrentPreviewItem - saveSelected: () => { + saveSelected: async () => { const state = get(store) - state.currentFrontEndType === "page" - ? store.actions.pages.save() - : store.actions.screens.save(state.currentPreviewItem) + if (state.currentFrontEndType !== "page") { + await store.actions.screens.save(state.currentPreviewItem) + } + await store.actions.pages.save() }, }, pages: { diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte index 9c42c0413e..39d5f92a92 100644 --- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte +++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte @@ -55,16 +55,7 @@ for (let screen of screens) { // Record the table that created this screen so we can link it later screen.autoTableId = table._id - try { - await store.actions.screens.create(screen) - } catch (_) { - // TODO: this is temporary - // a cypress test is failing, because I added the - // NewRow component. So - this throws an exception - // because the currently released standard-components (on NPM) - // does not have NewRow - // we should remove this after this has been released - } + await store.actions.screens.create(screen) } // Create autolink to newly created list page