Skip to content

Commit

Permalink
fixes to recent queries
Browse files Browse the repository at this point in the history
  • Loading branch information
lerouxb committed Jun 13, 2022
1 parent 2618f65 commit 09aca86
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const configureStore = (options = {}) => {
});

/* Ignore duplicate queries */
const existingQuery = this.state.items.find((item) => _.isEqual(comparableQuery(item), recent));
const existingQuery = this.state.items.map(comparableQuery).find((item) => _.isEqual(item, recent));
if (existingQuery) {
// update the existing query's lastExecuted to move it to the top
existingQuery._lastExecuted = Date.now();
Expand Down Expand Up @@ -103,8 +103,8 @@ const configureStore = (options = {}) => {
},

runQuery(query) {
if (this.state.items.map(item => item.serialize()).some(item => {
return _.isEqual(comparableQuery(item), query);
if (this.state.items.map(item => comparableQuery(item)).some(item => {
return _.isEqual(item, query);
})) {
track('Query History Recent Used');
}
Expand Down

0 comments on commit 09aca86

Please sign in to comment.