fix ctx menu on repeated block/unblock

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

@ -309,7 +309,7 @@ export class ConversationListItem extends React.PureComponent<Props> {
mentionedUs,
} = this.props;
const triggerId = `${phoneNumber}-ctxmenu-${Date.now()}`;
const triggerId = `conversation-item-${phoneNumber}-ctxmenu`;
return (
<div>

@ -389,7 +389,7 @@ export class ConversationHeader extends React.Component<Props> {
public render() {
const { id, isKickedFromGroup } = this.props;
const triggerId = `conversation-${id}-${Date.now()}`;
const triggerId = `conversation-header-${id}`;
return (
<>

@ -1073,11 +1073,11 @@ export class Message extends React.PureComponent<Props, State> {
// It needs to be unique.
// The Date.now() is a workaround to be sure a single triggerID with this id exists
const triggerId = id
? String(`${id}-${Date.now()}`)
: String(`${authorPhoneNumber}-${timestamp}`);
? String(`message-${id}-${Date.now()}`)
: String(`message-${authorPhoneNumber}-${timestamp}`);
const rightClickTriggerId = id
? String(`${id}-ctx-${Date.now()}`)
: String(`${authorPhoneNumber}-ctx-${timestamp}`);
? String(`message-ctx-${id}-${Date.now()}`)
: String(`message-ctx-${authorPhoneNumber}-${timestamp}`);
if (expired) {
return null;
}

@ -304,7 +304,14 @@ export function getResetSessionMenuItem(
action: any,
i18n: LocalizerType
): JSX.Element | null {
if (showResetSession(Boolean(isPublic), Boolean(isRss), Boolean(isGroup), Boolean(isBlocked),)) {
if (
showResetSession(
Boolean(isPublic),
Boolean(isRss),
Boolean(isGroup),
Boolean(isBlocked)
)
) {
return <MenuItem onClick={action}>{i18n('resetSession')}</MenuItem>;
}
return null;

Loading…
Cancel
Save