Skip to content

Commit

Permalink
display saved searches as latest first
Browse files Browse the repository at this point in the history
  • Loading branch information
prakhyatox committed Jun 17, 2024
1 parent 4ca057f commit 4dc5aa0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ export default {
mapSearches.set(search.id, search);
}
//Reversed array to show latest entry first
this.totalSearches = [...mapSearches.values()].toReversed();
let searchValues = [...mapSearches.values()];
this.totalSearches = searchValues.sort((a, b) => new Date(b.createdAt)
- new Date(a.createdAt)
);
},
/**
Expand Down

0 comments on commit 4dc5aa0

Please sign in to comment.