diff --git a/src/js/views/chat/ChatListItem.tsx b/src/js/views/chat/ChatListItem.tsx index ea63caa8..2f8f75e8 100644 --- a/src/js/views/chat/ChatListItem.tsx +++ b/src/js/views/chat/ChatListItem.tsx @@ -96,10 +96,10 @@ class ChatListItem extends BaseComponent {
+ {time} - {time} + {this.state.latestText}
- {this.state.latestText} {unseenEl} diff --git a/src/js/views/chat/ChatMessageForm.tsx b/src/js/views/chat/ChatMessageForm.tsx index 99bd2c00..37d1b255 100644 --- a/src/js/views/chat/ChatMessageForm.tsx +++ b/src/js/views/chat/ChatMessageForm.tsx @@ -44,14 +44,19 @@ class ChatMessageForm extends BaseComponent { e.stopPropagation(); const textEl = $(this.base).find('.new-msg'); const text = textEl.val() as string; + console.log('text', text); if (!text.length) { return; } + const content = await this.encrypt(text); + console.log('2text', text); + const recipient = Key.toNostrHexAddress(this.props.activeChat); if (!recipient) { throw new Error('invalid public key ' + recipient); } + console.log('asdf'); Events.publish({ kind: 4, content, @@ -80,13 +85,15 @@ class ChatMessageForm extends BaseComponent { return (
this.onSubmit(e)} > this.onMsgTextInput(e)} onKeyDown={(e: KeyboardEvent) => this.onKeyDown(e)} - class="new-msg" type="text" placeholder="Type a message" autocomplete="off" @@ -94,8 +101,8 @@ class ChatMessageForm extends BaseComponent { autocapitalize="sentences" spellCheck={true} /> - ); diff --git a/src/js/views/chat/PrivateChat.tsx b/src/js/views/chat/PrivateChat.tsx index f86abe04..198ed206 100644 --- a/src/js/views/chat/PrivateChat.tsx +++ b/src/js/views/chat/PrivateChat.tsx @@ -225,7 +225,11 @@ class PrivateChat extends PureComponent { }); mainView = ( -
this.onMessageViewScroll()}> +
this.onMessageViewScroll()} + >
{msgListContent}

@@ -249,13 +253,11 @@ class PrivateChat extends PureComponent {

this.scrollDown()}>
-
- this.scrollDown()} - /> -
+ this.scrollDown()} + /> ) : ( '' @@ -268,7 +270,7 @@ class PrivateChat extends PureComponent { {(this.chat && this.chat.name) || 'Messages'} -
+
{this.renderMainView()} {this.renderMsgForm()}