21364: added comment for lastQuery var Arvados-DCO-1.1-Signed-off-by: Lisa Knox...
authorLisa Knox <lisaknox83@gmail.com>
Mon, 6 May 2024 19:05:53 +0000 (15:05 -0400)
committerLisa Knox <lisaknox83@gmail.com>
Thu, 30 May 2024 17:58:10 +0000 (13:58 -0400)
services/workbench2/src/store/search-results-panel/search-results-middleware-service.ts

index 562b3126e80ab312856ad14d6e7a0d55a29101c6..866e148bcd73de296fd262231080c32bd34a78e1 100644 (file)
@@ -41,6 +41,9 @@ export class SearchResultsMiddlewareService extends DataExplorerMiddlewareServic
         const { cluster: clusterId } = getAdvancedDataFromQuery(searchValue);
         const sessions = getSearchSessions(clusterId, state.auth.sessions);
         const recentQueries = this.services.searchService.getRecentQueries();
+        //the last query is compared to the current query to check if the value has changed
+        //once the search button is clicked, the value is pushed to the recentQueries array
+        //therefore, the last query is the second to last element in the array 
         const lastQuery = recentQueries[recentQueries.length - 2];
 
         if (searchValue.trim() === '') {