diff --git a/packages/builder/src/builderStore/store/index.js b/packages/builder/src/builderStore/store/index.js index bb61712f1a..5a6c8581aa 100644 --- a/packages/builder/src/builderStore/store/index.js +++ b/packages/builder/src/builderStore/store/index.js @@ -106,10 +106,6 @@ const setPackage = (store, initial) => async pkg => { initial.pages = pkg.pages initial.hasAppPackage = true initial.screens = values(pkg.screens) - initial.allScreens = [ - ...Object.values(main_screens), - ...Object.values(unauth_screens), - ] initial.builtins = [getBuiltin("##builtin/screenslot")] initial.appInstances = pkg.application.instances initial.appId = pkg.application._id @@ -139,7 +135,6 @@ const _saveScreen = async (store, s, screen) => { innerState.pages[pageName]._screens = screens innerState.screens = screens innerState.currentPreviewItem = screen - innerState.allScreens = [...innerState.allScreens, screen] const safeProps = makePropsSafe( innerState.components[screen.props._component], screen.props diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte index 29c24a2926..a931dafb62 100644 --- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte +++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte @@ -52,6 +52,8 @@ .map(template => template.create()) 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.createScreen(screen) } catch (_) { diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index 79d31665b8..2b74e9c288 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -30,8 +30,8 @@ } function showModal() { - const screens = $store.allScreens - templateScreens = screens.filter(screen => screen.props.table === table._id) + const screens = $store.screens + templateScreens = screens.filter(screen => screen.autoTableId === table._id) willBeDeleted = ["All table data"].concat( templateScreens.map(screen => `Screen ${screen.props._instanceName}`) ) diff --git a/packages/builder/src/components/userInterface/EventsEditor/StateBindingCascader.svelte b/packages/builder/src/components/userInterface/EventsEditor/StateBindingCascader.svelte index d5e7422446..cb1d1dd1dd 100644 --- a/packages/builder/src/components/userInterface/EventsEditor/StateBindingCascader.svelte +++ b/packages/builder/src/components/userInterface/EventsEditor/StateBindingCascader.svelte @@ -29,7 +29,7 @@ {:else if parameter.name === 'url'} diff --git a/packages/builder/src/pages/index.svelte b/packages/builder/src/pages/index.svelte index a5a799f825..09fa40d1c7 100644 --- a/packages/builder/src/pages/index.svelte +++ b/packages/builder/src/pages/index.svelte @@ -56,7 +56,7 @@