Skip to content

Commit

Permalink
fix(snippets): sort by updatedAt
Browse files Browse the repository at this point in the history
  • Loading branch information
antonreshetov committed Apr 15, 2022
1 parent 72a1d5d commit f5f50e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/store/snippets.ts
Expand Up @@ -77,7 +77,7 @@ export const useSnippetStore = defineStore('snippets', {
return i
})

this.all.sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1))
this.all.sort((a, b) => (a.updatedAt > b.updatedAt ? -1 : 1))
},
async getSnippetsByFolderIds (ids: string[]) {
const snippets: SnippetWithFolder[] = []
Expand All @@ -94,7 +94,7 @@ export const useSnippetStore = defineStore('snippets', {

this.snippets = snippets
.filter(i => !i.isDeleted)
.sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1))
.sort((a, b) => (a.updatedAt > b.updatedAt ? -1 : 1))
},
async getSnippetsById (id: string) {
if (id) {
Expand Down

0 comments on commit f5f50e6

Please sign in to comment.