From 84d5d69aa87fefa4d403051f33eedd65c49381ce Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 27 Apr 2022 12:47:54 +0100 Subject: [PATCH] Update client library to properly handle new screen navigation settings --- packages/client/src/stores/screens.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/client/src/stores/screens.js b/packages/client/src/stores/screens.js index 2b19ac9aa9..5b9f760556 100644 --- a/packages/client/src/stores/screens.js +++ b/packages/client/src/stores/screens.js @@ -47,6 +47,20 @@ const createScreenStore = () => { // If we don't have a legacy custom layout, build a layout structure // from the screen navigation settings if (!activeLayout) { + let navigationProps = { + navigation: "None", + } + if (activeScreen.showNavigation) { + navigationProps = activeScreen.navigation + + // Legacy - if this is a legacy screen without any navigation + // settings fall back to just showing the app title + if (!navigationProps) { + navigationProps = { + title: activeScreen.navigation ?? $appStore.application?.name, + } + } + } activeLayout = { _id: "layout", props: { @@ -66,11 +80,7 @@ const createScreenStore = () => { }, }, ], - // If this is a legacy screen without any navigation settings, - // fall back to just showing the app title - ...(activeScreen.navigation || { - title: $appStore.application?.name, - }), + ...navigationProps, }, } }