File tree Expand file tree Collapse file tree
app/pages/clinicworkspace/TideDashboardV2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,8 +11,10 @@ const usePruneInvalidFilters = () => {
1111 const clinic = useSelector ( state => state . blip . clinics ?. [ selectedClinicId ] ) ;
1212 const { patientTags, clinicSites } = useSelector ( state => state . blip . tideDashboardFilters ) ;
1313
14+ const clinicId = clinic ?. id ;
15+
1416 useEffect ( ( ) => {
15- if ( ! patientTags ?. length || ! clinic ) return ;
17+ if ( ! patientTags ?. length || ! clinicId ) return ;
1618
1719 if ( isEqual ( patientTags , SPECIAL_FILTER_STATES . ZERO_TAGS ) ) return ;
1820
@@ -22,10 +24,10 @@ const usePruneInvalidFilters = () => {
2224 if ( prunedTags . length < patientTags . length ) {
2325 dispatch ( setPatientTagsFilter ( prunedTags ) ) ;
2426 }
25- } , [ ] ) ;
27+ } , [ clinicId ] ) ;
2628
2729 useEffect ( ( ) => {
28- if ( ! clinicSites ?. length || ! clinic ) return ;
30+ if ( ! clinicSites ?. length || ! clinicId ) return ;
2931
3032 if ( isEqual ( clinicSites , SPECIAL_FILTER_STATES . ZERO_SITES ) ) return ;
3133
@@ -35,7 +37,7 @@ const usePruneInvalidFilters = () => {
3537 if ( prunedSites . length < clinicSites . length ) {
3638 dispatch ( setClinicSitesFilter ( prunedSites ) ) ;
3739 }
38- } , [ ] ) ;
40+ } , [ clinicId ] ) ;
3941} ;
4042
4143export default usePruneInvalidFilters ;
You can’t perform that action at this time.
0 commit comments