File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,19 +72,23 @@ function Popover(props: PopoverProps) {
7272
7373 let isActive = true ;
7474 let baselineKey : string | undefined ;
75+ let baselineParamsStr : string | undefined ;
7576 // Holds the unsubscribe function once the subscription is set up asynchronously.
7677 const unsubscribeRef : { current : ( ( ) => void ) | undefined } = { current : undefined } ;
7778
7879 Navigation . isNavigationReady ( ) . then ( ( ) => {
7980 if ( ! isActive ) {
8081 return ;
8182 }
82- baselineKey = navigationRef . getCurrentRoute ( ) ?. key ;
83+ const initialRoute = navigationRef . getCurrentRoute ( ) ;
84+ baselineKey = initialRoute ?. key ;
85+ baselineParamsStr = JSON . stringify ( initialRoute ?. params ) ;
8386 unsubscribeRef . current = subscribeToRootNavigation ( ( ) => {
8487 if ( ! isActive || baselineKey === undefined ) {
8588 return ;
8689 }
87- if ( navigationRef . getCurrentRoute ( ) ?. key !== baselineKey ) {
90+ const currentRoute = navigationRef . getCurrentRoute ( ) ;
91+ if ( currentRoute ?. key !== baselineKey || JSON . stringify ( currentRoute ?. params ) !== baselineParamsStr ) {
8892 onClose ?.( ) ;
8993 }
9094 } ) ;
You can’t perform that action at this time.
0 commit comments