File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,6 @@ const NoImage = memo(
93
93
}
94
94
) ;
95
95
96
-
97
96
const AvatarImage = (
98
97
props : Pick < Props , 'base64Data' | 'dataTestId' > & {
99
98
avatarPath ?: string ;
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import {
10
10
useSelectedIsNoteToSelf ,
11
11
useSelectedIsPrivate ,
12
12
useSelectedIsPrivateFriend ,
13
+ useSelectedIsPublic ,
14
+ useSelectedWeAreAdmin ,
13
15
} from '../../../state/selectors/selectedConversation' ;
14
16
import { Avatar , AvatarSize } from '../../avatar/Avatar' ;
15
17
import { SessionIconButton } from '../../icon' ;
@@ -25,12 +27,16 @@ export const AvatarHeader = (props: { pubkey: string; onAvatarClick?: () => void
25
27
const isPrivate = useSelectedIsPrivate ( ) ;
26
28
const isGroupV2 = useIsGroupV2 ( pubkey ) ;
27
29
30
+ const isPublic = useSelectedIsPublic ( ) ;
31
+ const weAreAdmin = useSelectedWeAreAdmin ( ) ;
32
+
28
33
const canClickLegacy = isLegacyGroup && false ; // we can never click the avatar if it's a legacy group
29
34
const canClickPrivateApproved = isApproved && isPrivate ; // we can only click the avatar if it's a private and approved conversation
30
35
const canClick03GroupAccepted = isGroupV2 && ! invitePending ; // we can only click the avatar if it's a group and have accepted the invite already
36
+ const canClickCommunity = isPublic && weAreAdmin ;
31
37
32
38
const optOnAvatarClick =
33
- canClickLegacy || canClickPrivateApproved || canClick03GroupAccepted
39
+ canClickLegacy || canClickPrivateApproved || canClick03GroupAccepted || canClickCommunity
34
40
? onAvatarClick
35
41
: undefined ;
36
42
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function useEditProfilePicture({ conversationId }: { conversationId: string }) {
18
18
19
19
const hasQAButtonsOn = hasClosedGroupV2QAButtons ( ) ;
20
20
21
- return isMe || ( ( isPublic || isGroup ) && weAreAdmin && hasQAButtonsOn ) ;
21
+ return isMe || ( ( isPublic || ( isGroup && hasQAButtonsOn ) ) && weAreAdmin ) ;
22
22
}
23
23
24
24
export function useEditProfilePictureCallback ( { conversationId } : { conversationId : string } ) {
You can’t perform that action at this time.
0 commit comments