message container use column reverse to order messages from bottom to

top
pull/1387/head
Audric Ackermann 5 years ago
parent ef3f3d0af5
commit 6edadaf3e9
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -169,7 +169,7 @@
.messages-container { .messages-container {
display: flex; display: flex;
flex-grow: 1; flex-grow: 1;
flex-direction: column; flex-direction: column-reverse;
position: relative; position: relative;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;

@ -9,7 +9,7 @@ $accentDarkTheme: #00f782;
$borderLightTheme: #f1f1f1; // search for references on ts TODO: make this exposed on ts $borderLightTheme: #f1f1f1; // search for references on ts TODO: make this exposed on ts
$borderDarkTheme: rgba($white, 0.06); $borderDarkTheme: rgba($white, 0.06);
$borderAvatarColor: #00000059; // search for references on ts TODO: make this exposed on ts $borderAvatarColor: unquote('#00000059'); // search for references on ts TODO: make this exposed on ts
$themes: ( $themes: (
light: ( light: (

@ -497,17 +497,20 @@ export class SessionCompositionBox extends React.Component<Props, State> {
'attachments' 'attachments'
); );
const linkPreviews = stagedLinkPreview && [_.pick(stagedLinkPreview, 'url', 'image', 'title')] || [];
try { try {
const attachments = await this.getFiles(); const attachments = await this.getFiles();
await this.props.sendMessage( await this.props.sendMessage(
messagePlaintext, messagePlaintext,
attachments, attachments,
extractedQuotedMessageProps, extractedQuotedMessageProps,
[_.pick(stagedLinkPreview, 'url', 'image', 'title')], linkPreviews,
null, null,
{} {}
); );
// Message sending sucess // Message sending sucess
this.props.onMessageSuccess(); this.props.onMessageSuccess();
@ -518,6 +521,13 @@ export class SessionCompositionBox extends React.Component<Props, State> {
}); });
// Empty stagedAttachments // Empty stagedAttachments
this.props.clearAttachments(); this.props.clearAttachments();
if (stagedLinkPreview && stagedLinkPreview.url) {
this.setState({
stagedLinkPreview: undefined,
ignoredLink: undefined,
});
}
} catch (e) { } catch (e) {
// Message sending failed // Message sending failed
window.log.error(e); window.log.error(e);

@ -342,7 +342,7 @@ export class SessionConversation extends React.Component<Props, State> {
} }
); );
const messages = messageSet.models.reverse(); const messages = messageSet.models;
const messageFetchTimestamp = Date.now(); const messageFetchTimestamp = Date.now();
this.setState({ messages, messageFetchTimestamp }, () => { this.setState({ messages, messageFetchTimestamp }, () => {
@ -381,7 +381,7 @@ export class SessionConversation extends React.Component<Props, State> {
); );
// Set first member of series here. // Set first member of series here.
const messageModels = messageSet.models.reverse(); const messageModels = messageSet.models;
const messages = []; const messages = [];
let previousSender; let previousSender;

@ -90,10 +90,6 @@ export class SessionConversationMessagesList extends React.Component<
)?.messageCollection; )?.messageCollection;
} }
public async componentWillReceiveProps(nextProps: any) {
return;
}
public render() { public render() {
const { messages } = this.props; const { messages } = this.props;

Loading…
Cancel
Save