fix: Fixed issue where Conflicts view is shown but the list is empty

This commit is contained in:
Aman Harwara
2023-06-29 17:54:38 +05:30
parent efe069db06
commit 69de0e448f
3 changed files with 7 additions and 3 deletions

View File

@@ -278,7 +278,7 @@ export abstract class Collection<
this.typedMap[element.content_type] = array
}
public numberOfItemsWithConflicts(): number {
return this.conflictMap.directMapSize
public uuidsOfItemsWithConflicts(): string[] {
return this.conflictMap.getAllDirectKeys()
}
}

View File

@@ -1420,6 +1420,6 @@ export class ItemManager
}
public numberOfNotesWithConflicts(): number {
return this.collection.numberOfItemsWithConflicts()
return this.findItems(this.collection.uuidsOfItemsWithConflicts()).filter(Models.isNote).length
}
}

View File

@@ -37,6 +37,10 @@ export class UuidMap {
return this.directMap.get(uuid) || []
}
public getAllDirectKeys(): string[] {
return Array.from(this.directMap.keys())
}
public getInverseRelationships(uuid: string): string[] {
return this.inverseMap.get(uuid) || []
}