We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd7bb6d commit 17c9ce7Copy full SHA for 17c9ce7
src/service/database.js
@@ -207,9 +207,7 @@ export async function getComponents() {
207
}
208
209
export function sortByDate(dbItems) {
210
- const clonedDbItems = [...dbItems]
211
-
212
- return clonedDbItems.sort((itemA, itemB) => {
+ return dbItems.toSorted((itemA, itemB) => {
213
const dateA = new Date(itemA.updated)
214
const dateB = new Date(itemB.updated)
215
@@ -218,9 +216,7 @@ export function sortByDate(dbItems) {
218
216
219
217
220
export function sortByTitle(dbItems) {
221
222
223
224
const titleA = itemA.title
225
const titleB = itemB.title
226
0 commit comments