mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
web: update attachment manager dialog default filter to recently uploaded
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -122,8 +122,8 @@ export const AttachmentsDialog = DialogManager.register(
|
||||
});
|
||||
const [selected, setSelected] = useState<string[]>([]);
|
||||
const [sortBy, setSortBy] = useState<SortOptions>({
|
||||
id: "filename",
|
||||
direction: "asc"
|
||||
id: "dateUploaded",
|
||||
direction: "desc"
|
||||
});
|
||||
const currentRoute = useRef<Route>("all");
|
||||
const download = useStore((store) => store.download);
|
||||
@@ -165,7 +165,12 @@ export const AttachmentsDialog = DialogManager.register(
|
||||
)
|
||||
}
|
||||
filter={async (query) => {
|
||||
setAttachments(await db.lookup.attachments(query).sorted());
|
||||
setAttachments(
|
||||
await db.lookup.attachments(query).sorted({
|
||||
sortBy: sortBy.id,
|
||||
sortDirection: sortBy.direction
|
||||
})
|
||||
);
|
||||
}}
|
||||
counts={counts}
|
||||
onRouteChange={async (route) => {
|
||||
|
||||
Reference in New Issue
Block a user