mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
홈 페이지 구현
This commit is contained in:
10
src/routes/(main)/home/service.ts
Normal file
10
src/routes/(main)/home/service.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { getAllFileInfos } from "$lib/indexedDB";
|
||||
|
||||
export const requestFreshFilesRetrieval = async (limit = 8) => {
|
||||
const files = await getAllFileInfos();
|
||||
files.sort(
|
||||
(a, b) =>
|
||||
(b.createdAt ?? b.lastModifiedAt).getTime() - (a.createdAt ?? a.lastModifiedAt).getTime(),
|
||||
);
|
||||
return files.slice(0, limit);
|
||||
};
|
||||
Reference in New Issue
Block a user