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 MessageDeliveryStatus =
| 'sending'
@ -56,6 +58,9 @@ export interface MessageModel extends Backbone.Model<MessageAttributes> {
isUnread: () => boolean;
commit: () => Promise<number>;
getPropsForMessageDetail: () => any;
getConversation: () => ConversationModel;
handleMessageSentSuccess: (sentMessage: any, wrappedEnvelope: any) => any;
handleMessageSentFailure: (sentMessage: any, error: any) => any;
propsForMessage?: any;
propsForTimerNotification?: any;

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

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

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

@ -628,22 +628,7 @@ export class SessionCompositionBox extends React.Component<Props, State> {
}
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.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) {

Loading…
Cancel
Save