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, isPublic,
isRss, isRss,
isGroup, isGroup,
isBlocked,
onResetSession, onResetSession,
i18n i18n
); );

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

Loading…
Cancel
Save