generated from tpl/obsidian-sample-plugin
Fix last entry updating and remove logging
This commit is contained in:
parent
a7276211d4
commit
c58f1c4bf5
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue