mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-08-29 10:09:26 +02:00
mobile: sort attachment manager by recently uploaded
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -52,7 +52,7 @@ import Paragraph from "../ui/typography/paragraph";
|
||||
import { AttachmentItem } from "./attachment-item";
|
||||
|
||||
const DEFAULT_SORTING: SortOptions = {
|
||||
sortBy: "dateEdited",
|
||||
sortBy: "dateUploaded",
|
||||
sortDirection: "desc"
|
||||
};
|
||||
|
||||
@@ -154,21 +154,13 @@ export const AttachmentDialog = ({
|
||||
if (note) {
|
||||
db.attachments
|
||||
.ofNote(note.id, "all")
|
||||
.sorted({
|
||||
...DEFAULT_SORTING,
|
||||
sortBy: "dateModified"
|
||||
})
|
||||
.sorted(DEFAULT_SORTING)
|
||||
.then((attachments) => {
|
||||
setLoading(false);
|
||||
setAttachments(attachments);
|
||||
});
|
||||
} else {
|
||||
db.attachments.all
|
||||
.sorted({
|
||||
...DEFAULT_SORTING,
|
||||
sortBy: "dateModified"
|
||||
})
|
||||
.then((attachments) => {
|
||||
db.attachments.all.sorted(DEFAULT_SORTING).then((attachments) => {
|
||||
setAttachments(attachments);
|
||||
setLoading(false);
|
||||
});
|
||||
@@ -306,10 +298,7 @@ export const AttachmentDialog = ({
|
||||
: db.attachments.all;
|
||||
}
|
||||
|
||||
return await items.sorted({
|
||||
...DEFAULT_SORTING,
|
||||
sortBy: "dateModified"
|
||||
});
|
||||
return await items.sorted(DEFAULT_SORTING);
|
||||
};
|
||||
|
||||
db.attachments.orphaned.items().then((r) => {
|
||||
|
||||
Reference in New Issue
Block a user