-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicity in the list view (notes are sometimes showed twice) #36
Comments
It looks like the function that gets the notes is built with the default calendar view in mind so when passed to the import { PaneType, TFile } from "obsidian";
import * as React from "react";
import { CalendarItem } from "../CalendarType";
import { NoteAttributes } from "../TimeIndex";
import { NoteView } from "./NoteView";
export const NotesList = ({ calItem, items, onOpen }: {
calItem: CalendarItem,
items: NoteAttributes[],
onOpen: (note: TFile, paneType: PaneType | boolean) => void
}) => {
// Filter to get unique items based on note.path
const uniqueItems = items.filter((item, index, self) =>
index === self.findIndex(t => t.note.path === item.note.path)
);
return (
<div className="chronology-noteslist-container">
<div className="chronology-noteslist-wrapper">
{uniqueItems.map(item =>
<NoteView key={item.note.path + item.attribute} item={item} onOpen={onOpen} extraInfo={false} />
)}
</div>
</div>
);
}
export default NotesList; P.S. I am not a JS dev so this method might be horribly inefficient, looks like O(n^2) due to the nested loop. |
I have the same issue! |
Why are some notes duplicated in a list view? How can I deal with it?
My chronology setting:
The text was updated successfully, but these errors were encountered: