diff --git a/src/routes/log/+page.server.ts b/src/routes/log/+page.server.ts index 164642d..e2dcfb7 100644 --- a/src/routes/log/+page.server.ts +++ b/src/routes/log/+page.server.ts @@ -26,11 +26,12 @@ export const load = ({ url }) => { page = Math.max(page, 1) // get the notes from the chosen page - const notes = + const notes = new Map( notesList.slice((page - 1) * notesPerPage, page * notesPerPage) .map( - (id) => { return { noteId: id, note: readNote(id) } } + (id) => { return [id, readNote(id)] } ) + ) return { notes, highlightedNote: noteId, page } } diff --git a/src/routes/log/+page.svelte b/src/routes/log/+page.svelte index 8210fa8..98ce0b9 100644 --- a/src/routes/log/+page.svelte +++ b/src/routes/log/+page.svelte @@ -13,8 +13,17 @@ minute: "2-digit", }) } + + const highlightedNote = data.notes.get(data.highlightedNote ?? '') ?? null + + {#if highlightedNote !== null} + + + {/if} + +
gazesystems log file $file.name

-{#each data.notes as { noteId, note }, index} +{#each data.notes as [noteId, note], index}
  
-{#if index < data.notes.length - 1} +{#if index < data.notes.size - 1}
{/if} {/each}