Improve handling of payment notification messages
This commit is contained in:
parent
ccb517a218
commit
90d36350a7
1 changed files with 9 additions and 2 deletions
|
@ -89,7 +89,7 @@ import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations';
|
||||||
import { BadgeImageTheme } from '../../badges/BadgeImageTheme';
|
import { BadgeImageTheme } from '../../badges/BadgeImageTheme';
|
||||||
import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath';
|
import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath';
|
||||||
import { handleOutsideClick } from '../../util/handleOutsideClick';
|
import { handleOutsideClick } from '../../util/handleOutsideClick';
|
||||||
import { PaymentEventKind } from '../../types/Payment';
|
import { isPaymentNotificationEvent } from '../../types/Payment';
|
||||||
import type { AnyPaymentEvent } from '../../types/Payment';
|
import type { AnyPaymentEvent } from '../../types/Payment';
|
||||||
import { getPaymentEventDescription } from '../../messages/helpers';
|
import { getPaymentEventDescription } from '../../messages/helpers';
|
||||||
import { PanelType } from '../../types/Panels';
|
import { PanelType } from '../../types/Panels';
|
||||||
|
@ -1470,7 +1470,7 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
conversationColor,
|
conversationColor,
|
||||||
i18n,
|
i18n,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
if (payment == null || payment.kind !== PaymentEventKind.Notification) {
|
if (payment == null || !isPaymentNotificationEvent(payment)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1769,6 +1769,7 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
isSpoilerExpanded,
|
isSpoilerExpanded,
|
||||||
kickOffAttachmentDownload,
|
kickOffAttachmentDownload,
|
||||||
messageExpanded,
|
messageExpanded,
|
||||||
|
payment,
|
||||||
showConversation,
|
showConversation,
|
||||||
showSpoiler,
|
showSpoiler,
|
||||||
status,
|
status,
|
||||||
|
@ -1788,6 +1789,12 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Payment notifications are rendered in renderPayment, but they may have additional
|
||||||
|
// text in message.body for backwards-compatibility that we don't want to render
|
||||||
|
if (payment && isPaymentNotificationEvent(payment)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div // eslint-disable-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
<div // eslint-disable-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
||||||
className={classNames(
|
className={classNames(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue