diff --git a/components/recents/Recents.tsx b/components/recents/Recents.tsx index 20f3db7..fcf283c 100644 --- a/components/recents/Recents.tsx +++ b/components/recents/Recents.tsx @@ -42,7 +42,7 @@ export default function Recents() { // fetchData reads all notes. const fetchData = async () => { - try { setRecentsData(await db.notes.readAll()) } + try { setRecentsData(await db.notes.getRecents(cardCount)) } catch (error) { let description = 'An unknown error has occurred' if (error instanceof Error) { @@ -67,12 +67,12 @@ export default function Recents() { if (recentsData && recentsData.length > 0) { const recentsCardsList = recentsData.slice(0, cardCount).map((note, i) => (
{title}
-{desc}
+{desc}
{timeAgo(atime)}
diff --git a/lib/controller/NoteController.ts b/lib/controller/NoteController.ts index 0318ab8..81a63bc 100644 --- a/lib/controller/NoteController.ts +++ b/lib/controller/NoteController.ts @@ -8,6 +8,7 @@ export type Note = { atime : number mtime : number snippetContent? : string + contentPreview? : string } // NoteController manages notes in the database. @@ -60,9 +61,12 @@ class NoteController extends Database { return await this.select