Fixed #68
This commit is contained in:
@@ -47,8 +47,8 @@ export function getNoteFromCache(key: string): IndexedNote | undefined {
|
|||||||
export function getNonExistingNotesFromCache(): IndexedNote[] {
|
export function getNonExistingNotesFromCache(): IndexedNote[] {
|
||||||
return Object.values(notesCache).filter(note => note.doesNotExist)
|
return Object.values(notesCache).filter(note => note.doesNotExist)
|
||||||
}
|
}
|
||||||
export function addNoteToCache(key: string, note: IndexedNote): void {
|
export function addNoteToCache(filename: string, note: IndexedNote): void {
|
||||||
notesCache[key] = note
|
notesCache[filename] = note
|
||||||
}
|
}
|
||||||
export function removeNoteFromCache(key: string): void {
|
export function removeNoteFromCache(key: string): void {
|
||||||
delete notesCache[key]
|
delete notesCache[key]
|
||||||
|
|||||||
@@ -356,9 +356,9 @@ export async function addToIndex(file: TAbstractFile): Promise<void> {
|
|||||||
*/
|
*/
|
||||||
export function addNonExistingToIndex(name: string, parent: string): void {
|
export function addNonExistingToIndex(name: string, parent: string): void {
|
||||||
name = removeAnchors(name)
|
name = removeAnchors(name)
|
||||||
if (getNoteFromCache(name)) return
|
|
||||||
|
|
||||||
const filename = name + (name.endsWith('.md') ? '' : '.md')
|
const filename = name + (name.endsWith('.md') ? '' : '.md')
|
||||||
|
if (getNoteFromCache(filename)) return
|
||||||
|
|
||||||
const note = {
|
const note = {
|
||||||
path: filename,
|
path: filename,
|
||||||
basename: name,
|
basename: name,
|
||||||
|
|||||||
Reference in New Issue
Block a user