Skip to content

Commit f5f50e6

Browse files
committed
fix(snippets): sort by updatedAt
1 parent 72a1d5d commit f5f50e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/renderer/store/snippets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const useSnippetStore = defineStore('snippets', {
7777
return i
7878
})
7979

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

9595
this.snippets = snippets
9696
.filter(i => !i.isDeleted)
97-
.sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1))
97+
.sort((a, b) => (a.updatedAt > b.updatedAt ? -1 : 1))
9898
},
9999
async getSnippetsById (id: string) {
100100
if (id) {

0 commit comments

Comments
 (0)