rename textPending to bodyPending

not even sure we need it for Session
this is used when the users sends a really large body => it is sent as
an attachment
pull/1381/head
Audric Ackermann 4 years ago
parent 29eb528d1f
commit 8cc2cd6581
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1,3 +1,5 @@
import { ConversationModel } from './conversations';
type MessageModelType = 'incoming' | 'outgoing'; type MessageModelType = 'incoming' | 'outgoing';
type MessageDeliveryStatus = type MessageDeliveryStatus =
| 'sending' | 'sending'
@ -56,6 +58,9 @@ export interface MessageModel extends Backbone.Model<MessageAttributes> {
isUnread: () => boolean; isUnread: () => boolean;
commit: () => Promise<number>; commit: () => Promise<number>;
getPropsForMessageDetail: () => any; getPropsForMessageDetail: () => any;
getConversation: () => ConversationModel;
handleMessageSentSuccess: (sentMessage: any, wrappedEnvelope: any) => any;
handleMessageSentFailure: (sentMessage: any, error: any) => any;
propsForMessage?: any; propsForMessage?: any;
propsForTimerNotification?: any; propsForTimerNotification?: any;

@ -577,7 +577,7 @@
return { return {
text: this.createNonBreakingLastSeparator(this.get('body')), text: this.createNonBreakingLastSeparator(this.get('body')),
textPending: this.get('bodyPending'), bodyPending: this.get('bodyPending'),
id: this.id, id: this.id,
direction: this.isIncoming() ? 'incoming' : 'outgoing', direction: this.isIncoming() ? 'incoming' : 'outgoing',
timestamp: this.get('sent_at'), timestamp: this.get('sent_at'),

@ -55,7 +55,7 @@ export interface Props {
isDeletable: boolean; isDeletable: boolean;
isModerator?: boolean; isModerator?: boolean;
text?: string; text?: string;
textPending?: boolean; bodyPending?: boolean;
id: string; id: string;
collapseMetadata?: boolean; collapseMetadata?: boolean;
direction: 'incoming' | 'outgoing'; direction: 'incoming' | 'outgoing';
@ -249,7 +249,7 @@ export class Message extends React.PureComponent<Props, State> {
expirationTimestamp, expirationTimestamp,
status, status,
text, text,
textPending, bodyPending,
timestamp, timestamp,
serverTimestamp, serverTimestamp,
} = this.props; } = this.props;
@ -262,14 +262,14 @@ export class Message extends React.PureComponent<Props, State> {
const withImageNoCaption = Boolean(!text && isShowingImage); const withImageNoCaption = Boolean(!text && isShowingImage);
const showError = status === 'error' && direction === 'outgoing'; const showError = status === 'error' && direction === 'outgoing';
const showSentNoErrors = const showSentNoErrors =
!textPending && !bodyPending &&
direction === 'outgoing' && direction === 'outgoing' &&
status !== 'error' && status !== 'error' &&
status !== 'sending' && status !== 'sending' &&
status !== 'pow'; status !== 'pow';
const showSending = const showSending =
!textPending && !bodyPending &&
direction === 'outgoing' && direction === 'outgoing' &&
(status === 'sending' || status === 'pow'); (status === 'sending' || status === 'pow');
return ( return (
@ -764,7 +764,7 @@ export class Message extends React.PureComponent<Props, State> {
public renderText() { public renderText() {
const { const {
text, text,
textPending, bodyPending,
direction, direction,
status, status,
isRss, isRss,
@ -796,7 +796,7 @@ export class Message extends React.PureComponent<Props, State> {
text={contents || ''} text={contents || ''}
isRss={isRss} isRss={isRss}
i18n={window.i18n} i18n={window.i18n}
textPending={textPending} bodyPending={bodyPending}
isGroup={conversationType === 'group'} isGroup={conversationType === 'group'}
convoId={convoId} convoId={convoId}
/> />

@ -11,7 +11,7 @@ import { LocalizerType, RenderTextCallbackType } from '../../types/Util';
interface Props { interface Props {
text: string; text: string;
isRss?: boolean; isRss?: boolean;
textPending?: boolean; bodyPending?: boolean;
/** If set, all emoji will be the same size. Otherwise, just one emoji will be large. */ /** If set, all emoji will be the same size. Otherwise, just one emoji will be large. */
disableJumbomoji?: boolean; disableJumbomoji?: boolean;
/** If set, links will be left alone instead of turned into clickable `<a>` tags. */ /** If set, links will be left alone instead of turned into clickable `<a>` tags. */
@ -85,12 +85,12 @@ export class MessageBody extends React.Component<Props> {
}; };
public addDownloading(jsx: JSX.Element): JSX.Element { public addDownloading(jsx: JSX.Element): JSX.Element {
const { i18n, textPending } = this.props; const { i18n, bodyPending } = this.props;
return ( return (
<span className="text-selectable"> <span className="text-selectable">
{jsx} {jsx}
{textPending ? ( {bodyPending ? (
<span className="module-message-body__highlight"> <span className="module-message-body__highlight">
{' '} {' '}
{i18n('downloading')} {i18n('downloading')}
@ -103,7 +103,7 @@ export class MessageBody extends React.Component<Props> {
public render() { public render() {
const { const {
text, text,
textPending, bodyPending,
disableJumbomoji, disableJumbomoji,
disableLinks, disableLinks,
isRss, isRss,
@ -112,7 +112,7 @@ export class MessageBody extends React.Component<Props> {
convoId, convoId,
} = this.props; } = this.props;
const sizeClass = disableJumbomoji ? undefined : getSizeClass(text); const sizeClass = disableJumbomoji ? undefined : getSizeClass(text);
const textWithPending = textPending ? `${text}...` : text; const textWithPending = bodyPending ? `${text}...` : text;
const emoji = renderEmoji({ const emoji = renderEmoji({
i18n, i18n,

@ -628,22 +628,7 @@ export class SessionCompositionBox extends React.Component<Props, State> {
} }
private onClickAttachment(attachment: AttachmentType) { private onClickAttachment(attachment: AttachmentType) {
// const onSave = (caption: string) => {
// // eslint-disable-next-line no-param-reassign
// attachment.caption = caption;
// // this.captionEditorView.remove();
// // Signal.Backbone.Views.Lightbox.hide();
// this.render();
// };
this.setState({ showCaptionEditor: attachment }); this.setState({ showCaptionEditor: attachment });
// this.captionEditorView = new Whisper.ReactWrapperView({
// className: 'attachment-list-wrapper',
// Component: window.Signal.Components.CaptionEditor,
// props: getProps(),
// onClose: () => Signal.Backbone.Views.Lightbox.hide(),
// });
// Signal.Backbone.Views.Lightbox.show(this.captionEditorView.el);
} }
private renderCaptionEditor(attachment?: AttachmentType) { private renderCaptionEditor(attachment?: AttachmentType) {

Loading…
Cancel
Save