Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: fix sorting attachments

Ammar Ahmedead87f706887
diff --git a/apps/mobile/app/components/attachments/index.tsx b/apps/mobile/app/components/attachments/index.tsx
index 9563f8b58..f5e9cebbb 100644
--- a/apps/mobile/app/components/attachments/index.tsx
+++ b/apps/mobile/app/components/attachments/index.tsx
@@ -61,10 +61,16 @@ export const AttachmentDialog = ({ note }: { note?: Note }) => {
const refresh = React.useCallback(() => {
if (note) {
- db.attachments.ofNote(note.id, "all").sorted(DEFAULT_SORTING);
+ db.attachments.ofNote(note.id, "all").sorted({
+ ...DEFAULT_SORTING,
+ sortBy: "dateModified"
+ });
} else {
db.attachments.all
- .sorted(DEFAULT_SORTING)
+ .sorted({
+ ...DEFAULT_SORTING,
+ sortBy: "dateModified"
+ })
.then((attachments) => setAttachments(attachments));
}
}, [note]);
@@ -170,7 +176,10 @@ export const AttachmentDialog = ({ note }: { note?: Note }) => {
: db.attachments.documents;
}
- return await items.sorted(DEFAULT_SORTING);
+ return await items.sorted({
+ ...DEFAULT_SORTING,
+ sortBy: "dateModified"
+ });
};
return (