X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c038a5258d5790773ccca89a192c8c2b7dcd86cb..fe5d65e4e704358fab18d91dae5a97ff7659f5df:/src/views-components/search-bar/search-bar-save-queries.tsx

diff --git a/src/views-components/search-bar/search-bar-save-queries.tsx b/src/views-components/search-bar/search-bar-save-queries.tsx
index aa62c58f..5234c214 100644
--- a/src/views-components/search-bar/search-bar-save-queries.tsx
+++ b/src/views-components/search-bar/search-bar-save-queries.tsx
@@ -8,6 +8,7 @@ import { ArvadosTheme } from '~/common/custom-theme';
 import { RemoveIcon, EditSavedQueryIcon } from '~/components/icon/icon';
 import { SearchBarAdvanceFormData } from '~/models/search-bar';
 import { SearchBarSelectedItem } from "~/store/search-bar/search-bar-reducer";
+import { getQueryFromAdvancedData } from "~/store/search-bar/search-bar-actions";
 
 type CssRules = 'root' | 'listItem' | 'listItemText' | 'button';
 
@@ -48,10 +49,10 @@ export const SearchBarSavedQueries = withStyles(styles)(
     ({ classes, savedQueries, onSearch, editSavedQuery, deleteSavedQuery, selectedItem }: SearchBarSavedQueriesProps) =>
         <List component="nav" className={classes.root}>
             {savedQueries.map((query, index) =>
-                <ListItem button key={index} className={classes.listItem} selected={`SQ-${index}-${query.searchQuery}` === selectedItem.id}>
+                <ListItem button key={index} className={classes.listItem} selected={`SQ-${index}-${query.queryName}` === selectedItem.id}>
                     <ListItemText disableTypography
-                        secondary={query.searchQuery}
-                        onClick={() => onSearch(query.searchQuery)}
+                        secondary={query.queryName}
+                        onClick={() => onSearch(getQueryFromAdvancedData(query))}
                         className={classes.listItemText} />
                     <ListItemSecondaryAction>
                         <Tooltip title="Edit">
