@@ -28,7 +28,6 @@ type SidePanelStateContextProps = {
2828 sidePanelOffset : RefObject < Animated . Value > ;
2929 sidePanelTranslateX : RefObject < Animated . Value > ;
3030 sidePanelNVP ?: SidePanel ;
31- reportID ?: string ;
3231 sessionStartTime : string | null ;
3332} ;
3433
@@ -49,6 +48,8 @@ const SidePanelStateContext = createContext<SidePanelStateContextProps>({
4948 sessionStartTime : null ,
5049} ) ;
5150
51+ const SidePanelReportIDContext = createContext < string | undefined > ( undefined ) ;
52+
5253const SidePanelActionsContext = createContext < SidePanelActionsContextProps > ( {
5354 openSidePanel : ( ) => { } ,
5455 closeSidePanel : ( ) => { } ,
@@ -80,11 +81,12 @@ function SidePanelContextProvider({children}: PropsWithChildren) {
8081 } ) ;
8182
8283 const isRHPAdminsRoom = onboardingRHPVariant === CONST . ONBOARDING_RHP_VARIANT . RHP_ADMINS_ROOM ;
84+ const isRHPHomePage = onboardingRHPVariant === CONST . ONBOARDING_RHP_VARIANT . RHP_HOME_PAGE ;
8385 const isUserAdmin = isPolicyAdmin ( activePolicy , sessionEmail ) ;
8486 const isPolicyActive = shouldShowPolicy ( activePolicy , false , sessionEmail ?? '' ) ;
8587 const adminsChatReportID = activePolicy ?. chatReportIDAdmins ?. toString ( ) ;
8688
87- const reportID = isRHPAdminsRoom && isUserAdmin && isPolicyActive && adminsChatReportID ? adminsChatReportID : conciergeReportID ;
89+ const reportID = ( isRHPAdminsRoom || isRHPHomePage ) && isUserAdmin && isPolicyActive && adminsChatReportID ? adminsChatReportID : conciergeReportID ;
8890
8991 const [ sessionStartTime , setSessionStartTime ] = useState < string | null > ( null ) ;
9092 const [ prevShouldHideSidePanel , setPrevShouldHideSidePanel ] = useState ( shouldHideSidePanel ) ;
@@ -145,7 +147,6 @@ function SidePanelContextProvider({children}: PropsWithChildren) {
145147 sidePanelOffset,
146148 sidePanelTranslateX,
147149 sidePanelNVP,
148- reportID,
149150 sessionStartTime,
150151 } ;
151152
@@ -158,10 +159,12 @@ function SidePanelContextProvider({children}: PropsWithChildren) {
158159
159160 return (
160161 < SidePanelStateContext . Provider value = { stateValue } >
161- < SidePanelActionsContext . Provider value = { actionsValue } > { children } </ SidePanelActionsContext . Provider >
162+ < SidePanelReportIDContext . Provider value = { reportID } >
163+ < SidePanelActionsContext . Provider value = { actionsValue } > { children } </ SidePanelActionsContext . Provider >
164+ </ SidePanelReportIDContext . Provider >
162165 </ SidePanelStateContext . Provider >
163166 ) ;
164167}
165168
166169export default SidePanelContextProvider ;
167- export { SidePanelStateContext , SidePanelActionsContext } ;
170+ export { SidePanelStateContext , SidePanelReportIDContext , SidePanelActionsContext } ;
0 commit comments