feat: Added a conflict resolution dialog and a Conflicts view for easier management of conflicts (#2337)
This commit is contained in:
@@ -187,6 +187,8 @@ export abstract class Collection<
|
||||
const conflictOf = element.content.conflict_of
|
||||
if (conflictOf) {
|
||||
this.conflictMap.establishRelationship(conflictOf, element.uuid)
|
||||
} else if (this.conflictMap.getInverseRelationships(element.uuid).length > 0) {
|
||||
this.conflictMap.removeFromMap(element.uuid)
|
||||
}
|
||||
|
||||
this.referenceMap.setAllRelationships(
|
||||
@@ -203,6 +205,9 @@ export abstract class Collection<
|
||||
|
||||
if (element.deleted) {
|
||||
this.nondeletedIndex.delete(element.uuid)
|
||||
if (this.conflictMap.getInverseRelationships(element.uuid).length > 0) {
|
||||
this.conflictMap.removeFromMap(element.uuid)
|
||||
}
|
||||
} else {
|
||||
this.nondeletedIndex.add(element.uuid)
|
||||
}
|
||||
@@ -260,4 +265,8 @@ export abstract class Collection<
|
||||
remove(array, { uuid: element.uuid as never })
|
||||
this.typedMap[element.content_type] = array
|
||||
}
|
||||
|
||||
public numberOfItemsWithConflicts(): number {
|
||||
return this.conflictMap.directMapSize
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export class TagItemsIndex implements SNIndex {
|
||||
|
||||
private isItemCountable = (item: ItemInterface) => {
|
||||
if (isDecryptedItem(item)) {
|
||||
return !item.archived && !item.trashed
|
||||
return !item.archived && !item.trashed && !item.conflictOf
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user