Fix last entry updating and remove logging

This commit is contained in:
Evan Fiordeliso 2025-06-30 21:38:03 -04:00
parent a7276211d4
commit c58f1c4bf5
2 changed files with 1 additions and 2 deletions

View File

@ -45,7 +45,6 @@
await onChange?.(query);
});
$inspect(value, query, items);
$effect.root(() => {
function findIndex(value: T | undefined) {
return items.findIndex((item) => item.value === value);

View File

@ -87,7 +87,7 @@ export class ReadingLog {
if (lastEntry && isSameDay(lastEntry.createdAt, newEntry.createdAt)) {
newEntry.pagesRead += lastEntry.pagesRead;
await this.updateEntry(this.entries.indexOf(lastEntry), lastEntry);
await this.updateEntry(this.entries.indexOf(lastEntry), newEntry);
} else {
await this.addRawEntry(newEntry);
}