Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Dedupe profile labels (#7833)

* dedupe labels

* apply to postalerts

authored by

Samuel Newman and committed by
GitHub
6254cf02 61a14043

+18 -7
+3 -3
src/components/moderation/PostAlerts.tsx
··· 1 1 import {StyleProp, ViewStyle} from 'react-native' 2 2 import {ModerationCause, ModerationUI} from '@atproto/api' 3 3 4 - import {getModerationCauseKey} from '#/lib/moderation' 4 + import {getModerationCauseKey, unique} from '#/lib/moderation' 5 5 import * as Pills from '#/components/Pills' 6 6 7 7 export function PostAlerts({ ··· 22 22 23 23 return ( 24 24 <Pills.Row size={size} style={[size === 'sm' && {marginLeft: -3}, style]}> 25 - {modui.alerts.map(cause => ( 25 + {modui.alerts.filter(unique).map(cause => ( 26 26 <Pills.Label 27 27 key={getModerationCauseKey(cause)} 28 28 cause={cause} ··· 30 30 noBg={size === 'sm'} 31 31 /> 32 32 ))} 33 - {modui.informs.map(cause => ( 33 + {modui.informs.filter(unique).map(cause => ( 34 34 <Pills.Label 35 35 key={getModerationCauseKey(cause)} 36 36 cause={cause}
+3 -3
src/components/moderation/ProfileHeaderAlerts.tsx
··· 1 1 import {StyleProp, ViewStyle} from 'react-native' 2 2 import {ModerationDecision} from '@atproto/api' 3 3 4 - import {getModerationCauseKey} from '#/lib/moderation' 4 + import {getModerationCauseKey, unique} from '#/lib/moderation' 5 5 import * as Pills from '#/components/Pills' 6 6 7 7 export function ProfileHeaderAlerts({ ··· 17 17 18 18 return ( 19 19 <Pills.Row size="lg"> 20 - {modui.alerts.map(cause => ( 20 + {modui.alerts.filter(unique).map(cause => ( 21 21 <Pills.Label 22 22 size="lg" 23 23 key={getModerationCauseKey(cause)} 24 24 cause={cause} 25 25 /> 26 26 ))} 27 - {modui.informs.map(cause => ( 27 + {modui.informs.filter(unique).map(cause => ( 28 28 <Pills.Label 29 29 size="lg" 30 30 key={getModerationCauseKey(cause)}
+12
src/lib/moderation.ts
··· 137 137 } 138 138 }, [label]) 139 139 } 140 + 141 + export function unique( 142 + value: ModerationCause, 143 + index: number, 144 + array: ModerationCause[], 145 + ) { 146 + return ( 147 + array.findIndex( 148 + item => getModerationCauseKey(item) === getModerationCauseKey(value), 149 + ) === index 150 + ) 151 + }
-1
src/screens/Profile/Header/Shell.tsx
··· 199 199 height: 30, 200 200 overflow: 'hidden', 201 201 borderRadius: 15, 202 - // @ts-ignore web only 203 202 cursor: 'pointer', 204 203 backgroundColor: 'rgba(0, 0, 0, 0.5)', 205 204 alignItems: 'center',