Skip to content

Commit

Permalink
Sort notes globally (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbrillig authored Sep 9, 2024
1 parent 5983d60 commit 048114d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/renderer/lib/gitnews-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ export function createFetcher(): Middleware<{}, AppReduxState> {
}
allNotes = [...allNotes, ...notes];
}
allNotes.sort((a, b) => {
if (a.updatedAt < b.updatedAt) {
return 1;
}
if (a.updatedAt > b.updatedAt) {
return -1;
}
return 0;
});
return allNotes;
};
}
Expand Down

0 comments on commit 048114d

Please sign in to comment.