From aeb0fd7356facbead7c31f35f673cca224f43e53 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 26 Sep 2022 13:59:00 +0100 Subject: [PATCH] Always try to migrate navigation settings when importing apps --- packages/server/src/api/controllers/application.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index a9cf1a834d..56054d1b58 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -304,7 +304,7 @@ const performAppCreate = async (ctx: any) => { }) // Migrate navigation settings and screens if required - if (existing && !existing.navigation) { + if (existing) { const navigation = await migrateAppNavigation() if (navigation) { newApplication.navigation = navigation @@ -601,7 +601,7 @@ const migrateAppNavigation = async () => { // Migrate all screens, removing custom layouts for (let screen of screens) { if (!screen.layoutId) { - return + continue } const layout = layouts.find(layout => layout._id === screen.layoutId) screen.layoutId = undefined @@ -615,7 +615,7 @@ const migrateAppNavigation = async () => { const layout = layouts?.find( (layout: Layout) => layout._id === BASE_LAYOUT_PROP_IDS.PRIVATE ) - if (layout) { + if (layout && !existing.navigation) { let navigationSettings: any = { navigation: "Top", title: name,