duplicateAffordances
What a duplicate warning shows and which buttons it offers, decided in one place so it can be tested without a browser and kept equal to the server's rule. It enforces nothing: the server refuses a duplicate on the write.
Import
import { duplicateAffordances } from '@conduction/nextcloud-vue'
Signature
function duplicateAffordances(state: {
matches?: object[],
checked?: boolean,
policy?: string,
mayOverride?: boolean,
}): { show: boolean, blocked: boolean, mayContinue: boolean, needsReason: boolean }
show: the check ran (checkedis notfalse) and found matches.blocked: shown, andpolicyisblock. Any other policy reads aswarn.mayContinue: shown, and either not blocked ormayOverride.needsReason: blocked andmayOverride: the override must say why.
Used by CnDuplicateWarning.