hide reset session from menu when user is blocked

pull/1334/head
Audric Ackermann 5 years ago
parent 2aef1f3132
commit d3badba681
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -475,6 +475,7 @@ export class ConversationHeader extends React.Component<Props> {
isPublic,
isRss,
isGroup,
isBlocked,
onResetSession,
i18n
);

@ -32,9 +32,10 @@ function showSafetyNumber(
function showResetSession(
isPublic: boolean,
isRss: boolean,
isGroup: boolean
isGroup: boolean,
isBlocked: boolean
): boolean {
return !isPublic && !isRss && !isGroup;
return !isPublic && !isRss && !isGroup && !isBlocked;
}
function showBlock(isMe: boolean, isPrivate: boolean): boolean {
@ -299,10 +300,11 @@ export function getResetSessionMenuItem(
isPublic: boolean | undefined,
isRss: boolean | undefined,
isGroup: boolean | undefined,
isBlocked: boolean | undefined,
action: any,
i18n: LocalizerType
): JSX.Element | null {
if (showResetSession(Boolean(isPublic), Boolean(isRss), Boolean(isGroup))) {
if (showResetSession(Boolean(isPublic), Boolean(isRss), Boolean(isGroup), Boolean(isBlocked),)) {
return <MenuItem onClick={action}>{i18n('resetSession')}</MenuItem>;
}
return null;

Loading…
Cancel
Save