Update client library to work with template screens in real preview

This commit is contained in:
Andrew Kingston 2020-12-04 14:04:07 +00:00
parent 75e4b4f8cd
commit 155c375ada
1 changed files with 15 additions and 14 deletions

View File

@ -20,20 +20,21 @@ const createScreenStore = () => {
activeScreen = $builderStore.screen activeScreen = $builderStore.screen
} else { } else {
// Otherwise find the correct screen by matching the current route // Otherwise find the correct screen by matching the current route
// const { screens, layouts } = $config const { screens, layouts } = $config
// activeLayout = layouts[0] console.log(screens)
// if (screens.length === 1) { activeLayout = layouts[0]
// activeScreen = screens[0] if (screens.length === 1) {
// } else { activeScreen = screens[0]
// activeScreen = screens.find( } else {
// screen => screen.routing.route === $routeStore.activeRoute activeScreen = screens.find(
// ) screen => screen.routing.route === $routeStore.activeRoute
// } )
// if (activeScreen) { }
// activeLayout = layouts.find( if (activeScreen) {
// layout => layout._id === activeScreen.props.layoutId activeLayout = layouts.find(
// ) layout => layout._id === activeScreen.props.layoutId
// } )
}
} }
return { activeLayout, activeScreen } return { activeLayout, activeScreen }
} }