@@ -68,18 +68,32 @@ const DataActionsBarProvider: FC<ProviderProps> = ({ children }) => {
6868 isAdjusting . current = false ;
6969 } , [ ] ) ;
7070
71+ const gADetailsPathnameRegexp = / ^ .* \/ g o v e r n a n c e _ a c t i o n s \/ [ a - f A - F 0 - 9 ] { 64 } $ / ;
7172 const userMovedToDifferentAppArea =
7273 pathname !== lastPath &&
7374 ( ! pathname . startsWith ( lastPath ) || lastPath === "" || lastPath === "/" ) ;
75+ const userOpenedGADetails = gADetailsPathnameRegexp . test ( pathname ) ;
7476 const userOpenedGADetailsFromCategoryPage =
75- lastPath . includes ( "governance_actions/category" ) &&
76- pathname . includes ( "governance_actions/" ) ;
77+ userOpenedGADetails &&
78+ lastPath . includes ( "governance_actions/category " ) ;
7779 const userMovedFromGAListToCategoryPage =
7880 lastPath . endsWith ( "governance_actions" ) &&
7981 pathname . includes ( "governance_actions/category" ) ;
82+ const userMovedFromGADetailsToListOrCategoryPage =
83+ ( gADetailsPathnameRegexp . test ( lastPath ) &&
84+ pathname . includes ( "governance_actions" ) ) ||
85+ pathname . includes ( "governance_actions/category" ) ;
8086
8187 useEffect ( ( ) => {
8288 isAdjusting . current = true ;
89+ if ( userOpenedGADetails ) {
90+ return ;
91+ }
92+
93+ if ( userMovedFromGADetailsToListOrCategoryPage && debouncedSearchText . length > 0 ) {
94+ isAdjusting . current = false ;
95+ return ;
96+ }
8397
8498 if (
8599 ( ! pathname . includes ( "drep_directory" ) &&
@@ -93,7 +107,7 @@ const DataActionsBarProvider: FC<ProviderProps> = ({ children }) => {
93107
94108 useEffect ( ( ) => {
95109 setLastPath ( pathname ) ;
96- } , [ searchText , chosenFilters , chosenSorting ] ) ;
110+ } , [ pathname , searchText , chosenFilters , chosenSorting ] ) ;
97111
98112 const contextValue = useMemo (
99113 ( ) => ( {
0 commit comments