File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1136,7 +1136,7 @@ const QueryBrowserWrapper: FC<{
11361136 if ( isFirstRender ) {
11371137 return ;
11381138 }
1139- const newParams = new URLSearchParams ( queryParams ) ;
1139+ const newParams = new URLSearchParams ( removeQueryKeys ( queryParams ) ) ;
11401140 queryStrings . forEach ( ( query , i ) => newParams . set ( `query${ i } ` , query || '' ) ) ;
11411141 if ( customDataSourceName ) {
11421142 newParams . set ( QueryParams . Datasource , customDataSourceName ) ;
@@ -1215,6 +1215,16 @@ const QueryBrowserWrapper: FC<{
12151215 ) ;
12161216} ;
12171217
1218+ const removeQueryKeys = ( searchParams : URLSearchParams ) : URLSearchParams => {
1219+ const newParams = new URLSearchParams ( searchParams ) ;
1220+ for ( const key of searchParams . keys ( ) ) {
1221+ if ( key . startsWith ( 'query' ) ) {
1222+ newParams . delete ( key ) ;
1223+ }
1224+ }
1225+ return newParams ;
1226+ } ;
1227+
12181228const AddQueryButton : FC = ( ) => {
12191229 const { t } = useTranslation ( process . env . I18N_NAMESPACE ) ;
12201230
You can’t perform that action at this time.
0 commit comments