Skip to content

Commit ee5fc69

Browse files
authored
feat: don't show overlay for submitted application to operator (eclipse-tractusx#1204)
eclipse-tractusx#1203
1 parent bb8e63f commit ee5fc69

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/components/shared/frame/Header/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)