@@ -84,6 +84,7 @@ export async function mountApp({
8484
8585 const spacesApi = pluginsStart . spacesOss ?. isSpacesAvailable ? pluginsStart . spacesOss : undefined ;
8686 const activeSpaceId = spacesApi && ( await spacesApi . activeSpace$ . pipe ( first ( ) ) . toPromise ( ) ) ?. id ;
87+ let globalEmbedSettings : DashboardEmbedSettings | undefined ;
8788
8889 const dashboardServices : DashboardAppServices = {
8990 navigation,
@@ -149,9 +150,6 @@ export async function mountApp({
149150 const getDashboardEmbedSettings = (
150151 routeParams : ParsedQuery < string >
151152 ) : DashboardEmbedSettings | undefined => {
152- if ( ! routeParams . embed ) {
153- return undefined ;
154- }
155153 return {
156154 forceShowTopNavMenu : Boolean ( routeParams [ dashboardUrlParams . showTopMenu ] ) ,
157155 forceShowQueryInput : Boolean ( routeParams [ dashboardUrlParams . showQueryInput ] ) ,
@@ -162,11 +160,13 @@ export async function mountApp({
162160
163161 const renderDashboard = ( routeProps : RouteComponentProps < { id ?: string } > ) => {
164162 const routeParams = parse ( routeProps . history . location . search ) ;
165- const embedSettings = getDashboardEmbedSettings ( routeParams ) ;
163+ if ( routeParams . embed && ! globalEmbedSettings ) {
164+ globalEmbedSettings = getDashboardEmbedSettings ( routeParams ) ;
165+ }
166166 return (
167167 < DashboardApp
168168 history = { routeProps . history }
169- embedSettings = { embedSettings }
169+ embedSettings = { globalEmbedSettings }
170170 savedDashboardId = { routeProps . match . params . id }
171171 redirectTo = { ( props : RedirectToProps ) => redirect ( routeProps , props ) }
172172 />
0 commit comments