@@ -3,7 +3,7 @@ import React, { useEffect, FC, useMemo } from 'react';
3
3
import { useDispatch } from 'react-redux' ;
4
4
5
5
import { locationService as locationSrv , HistoryWrapper } from '@grafana/runtime' ;
6
- import { setInitialMountState } from 'app/core/reducers/fn-slice' ;
6
+ import { FnGlobalState , setInitialMountState } from 'app/core/reducers/fn-slice' ;
7
7
import DashboardPage , { DashboardPageProps } from 'app/features/dashboard/containers/DashboardPage' ;
8
8
import { FnLoggerService } from 'app/fn_logger' ;
9
9
import { DashboardRoutes , StoreState , useSelector } from 'app/types' ;
@@ -68,19 +68,20 @@ export const RenderFNDashboard: FC<FNDashboardProps> = (props) => {
68
68
} , [ firstError , setErrors ] ) ;
69
69
70
70
useEffect ( ( ) => {
71
- FnLoggerService . log ( null , '[FN Grafana] Trying to set initial state...' ) ;
72
-
73
- dispatch (
74
- setInitialMountState ( {
75
- FNDashboard : true ,
76
- uid,
77
- slug,
78
- mode,
79
- controlsContainer,
80
- pageTitle,
81
- queryParams,
82
- } )
83
- ) ;
71
+ const initialState : FnGlobalState = {
72
+ FNDashboard : true ,
73
+ uid,
74
+ slug,
75
+ mode,
76
+ controlsContainer,
77
+ pageTitle,
78
+ queryParams,
79
+ hiddenVariables,
80
+ } ;
81
+
82
+ FnLoggerService . log ( null , '[FN Grafana] Trying to set initial state.' , { initialState } ) ;
83
+
84
+ dispatch ( setInitialMountState ( initialState ) ) ;
84
85
85
86
// TODO: catch success in redux-thunk way
86
87
FnLoggerService . log (
@@ -92,8 +93,7 @@ export const RenderFNDashboard: FC<FNDashboardProps> = (props) => {
92
93
) ;
93
94
94
95
locationService . fnPathnameChange ( window . location . pathname , queryParams ) ;
95
-
96
- } , [ dispatch , uid , slug , controlsContainer , pageTitle , queryParams , mode ] ) ;
96
+ } , [ dispatch , uid , slug , controlsContainer , pageTitle , queryParams , mode , hiddenVariables ] ) ;
97
97
98
98
const dashboardPageProps : DashboardPageProps = useMemo ( ( ) => merge ( { } , DEFAULT_DASHBOARD_PAGE_PROPS , {
99
99
...DEFAULT_DASHBOARD_PAGE_PROPS ,
0 commit comments