Skip to content

Commit

Permalink
[ES|QL] Clear the cached queries correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Dec 19, 2024
1 parent 9f01087 commit 864a126
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ export const addQueriesToCache = (

// queries to store in the localstorage
allQueries = sortedByDate.slice(0, maxQueriesAllowed);
// clear and reset the queries in the cache
cachedQueries.clear();
allQueries.forEach((queryItem) => {
cachedQueries.set(queryItem.queryString, queryItem);
});
}
// clear and reset the queries in the cache
cachedQueries.clear();
localStorage.setItem(QUERY_HISTORY_ITEM_KEY, JSON.stringify(allQueries));
};

0 comments on commit 864a126

Please sign in to comment.