11import React , { FC } from 'react'
2- import AccountStore from 'common/stores/account-store'
32import { Link , NavLink } from 'react-router-dom'
43import BreadcrumbSeparator from 'components/BreadcrumbSeparator'
54import classNames from 'classnames'
65import Utils from 'common/utils/utils'
76import { Project } from 'common/types/responses'
8- import { useGetOrganisationQuery } from 'common/services/useOrganisation '
7+ import useSelectedOrganisation from 'common/hooks/useSelectedOrganisation '
98import { appLevelPaths } from './constants'
109
1110type SelectOrgAndProjectType = {
@@ -18,12 +17,7 @@ const SelectOrgAndProject: FC<SelectOrgAndProjectType> = ({
1817 projectId,
1918} ) => {
2019 const isAppLevelPage = appLevelPaths . includes ( document . location . pathname )
21-
22- const organisationId = AccountStore . getOrganisation ( ) ?. id
23- const { data : organisation } = useGetOrganisationQuery (
24- { id : organisationId as number } ,
25- { skip : ! organisationId } ,
26- )
20+ const organisation = useSelectedOrganisation ( )
2721
2822 return (
2923 < Row className = 'gap-2' >
@@ -57,9 +51,7 @@ const SelectOrgAndProject: FC<SelectOrgAndProjectType> = ({
5751 } ) }
5852 to = { Utils . getOrganisationHomePage ( ) }
5953 >
60- < div >
61- { organisation ?. name || AccountStore . getOrganisation ( ) ?. name }
62- </ div >
54+ < div > { organisation ?. name } </ div >
6355 </ NavLink >
6456 </ BreadcrumbSeparator >
6557 </ div >
0 commit comments