about summary refs log tree commit diff
path: root/src/view/com/profile/ProfileCard.tsx
diff options
context:
space:
mode:
authorAnsh <anshnanda10@gmail.com>2023-08-15 13:32:57 -0500
committerGitHub <noreply@github.com>2023-08-15 11:32:57 -0700
commit77178844fd29e2b7b4637557c4068901da0ef4e8 (patch)
treeb842ac1a9ed9f403346fdd9caeb6082d7b299cfd /src/view/com/profile/ProfileCard.tsx
parent94527a4d9eaa388239f59d91da252fe0bafac088 (diff)
downloadvoidsky-77178844fd29e2b7b4637557c4068901da0ef4e8.tar.zst
[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>
Diffstat (limited to 'src/view/com/profile/ProfileCard.tsx')
-rw-r--r--src/view/com/profile/ProfileCard.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/view/com/profile/ProfileCard.tsx b/src/view/com/profile/ProfileCard.tsx
index ba0c59def..771785ee9 100644
--- a/src/view/com/profile/ProfileCard.tsx
+++ b/src/view/com/profile/ProfileCard.tsx
@@ -19,6 +19,7 @@ import {makeProfileLink} from 'lib/routes/links'
 import {
   describeModerationCause,
   getProfileModerationCauses,
+  getModerationCauseKey,
 } from 'lib/moderation'
 
 export const ProfileCard = observer(
@@ -131,7 +132,9 @@ function ProfileCardPills({
       {causes.map(cause => {
         const desc = describeModerationCause(cause, 'account')
         return (
-          <View style={[s.mt5, pal.btn, styles.pill]}>
+          <View
+            style={[s.mt5, pal.btn, styles.pill]}
+            key={getModerationCauseKey(cause)}>
             <Text type="xs" style={pal.text}>
               {cause?.type === 'label' ? '⚠' : ''}
               {desc.name}