[APP-798] add key to ProfileCardPills
render method (#1158)
* add key to `ProfileCardPills` render method * More reliable key generation --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
parent
94527a4d9e
commit
77178844fd
2 changed files with 17 additions and 1 deletions
|
@ -92,3 +92,16 @@ export function isCauseALabelOnUri(
|
|||
}
|
||||
return cause.label.uri === uri
|
||||
}
|
||||
|
||||
export function getModerationCauseKey(cause: ModerationCause): string {
|
||||
const source =
|
||||
cause.source.type === 'labeler'
|
||||
? cause.source.labeler.did
|
||||
: cause.source.type === 'list'
|
||||
? cause.source.list.uri
|
||||
: 'user'
|
||||
if (cause.type === 'label') {
|
||||
return `label:${cause.label.val}:${source}`
|
||||
}
|
||||
return `${cause.type}:${source}`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue