From 8022fc12300c86bbf45bf78374e84bcf6e09ba6b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 9 Dec 2020 19:04:46 +0000 Subject: [PATCH] Select new role when creating screen with a different role than the selected one --- packages/builder/src/builderStore/store/frontend.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 280af804cb..dc6706373a 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -10,6 +10,7 @@ import { currentAsset, mainLayout, selectedComponent, + selectedAccessRole, } from "builderStore" import { fetchComponentLibDefinitions } from "../loadComponentLibraries" import api from "../api" @@ -88,6 +89,11 @@ export const getFrontendStore = () => { let screen = screens.find(screen => screen._id === screenId) || screens[0] if (!screen) return state + + // Update role to the screen's role setting so that it will always + // be visible + selectedAccessRole.set(screen.routing.roleId) + state.currentFrontEndType = FrontendTypes.SCREEN state.currentAssetId = screen._id state.currentView = "detail"