File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,19 @@ export const Header = ({
7272 const { data } = useFetchApplicationsQuery ( )
7373 const companyData = data ?. [ 0 ]
7474 const { data : companyDetails } = useFetchOwnCompanyDetailsQuery ( '' )
75- const [ submittedOverlayOpen , setSubmittedOverlayOpen ] = useState (
76- companyData ?. applicationStatus === ApplicationStatus . SUBMITTED
77- )
75+ const [ submittedOverlayOpen , setSubmittedOverlayOpen ] =
76+ useState < boolean > ( false )
7877 const [ headerNote , setHeaderNote ] = useState ( false )
7978 const [ pages , setPages ] = useState < string [ ] > ( [ ] )
8079
80+ useEffect ( ( ) => {
81+ if ( ! ( companyData && companyDetails ) ) return
82+ setSubmittedOverlayOpen (
83+ ! companyDetails ?. companyRole . includes ( 'OPERATOR' ) &&
84+ companyData ?. applicationStatus === ApplicationStatus . SUBMITTED
85+ )
86+ } , [ companyData , companyDetails ] )
87+
8188 useEffect ( ( ) => {
8289 if ( companyDetails ?. companyRole . includes ( 'ONBOARDING_SERVICE_PROVIDER' ) ) {
8390 setPages ( user )
You can’t perform that action at this time.
0 commit comments