diff --git a/src/pages/profile/index.css b/src/pages/profile/index.css index b3aac16..627b72c 100644 --- a/src/pages/profile/index.css +++ b/src/pages/profile/index.css @@ -10,3 +10,6 @@ div.console-container { div.compose-container { flex-grow: 1; } +#left { + min-width: 0; +} diff --git a/src/pages/profile/message.ts b/src/pages/profile/message.ts index 13aaa3b..bb4bcd2 100644 --- a/src/pages/profile/message.ts +++ b/src/pages/profile/message.ts @@ -44,8 +44,23 @@ export default class MessageCard implements m.ClassComponent { [ m( "span", - { style: { flexGrow: 1 } }, - `${header} - ${message.timestamp.toLocaleTimeString()}` + { style: { display: 'flex', minWidth: 0, flex: 'auto' } }, + m( + "div", + { + style: { + overflow: 'hidden', + whiteSpace: 'nowrap', + textOverflow: 'ellipsis', + wordBreak: 'break-word', + }, + }, + header + ), + m("div", + { style: {whiteSpace: 'nowrap', padding: '0 0.3rem'}}, + ` - ${message.timestamp.toLocaleTimeString()}` + ), ), m("span.icon", m(`i.fas.fa-${icon}`)), ] diff --git a/src/pages/profile/messaging.ts b/src/pages/profile/messaging.ts index ec24b96..b65acb7 100644 --- a/src/pages/profile/messaging.ts +++ b/src/pages/profile/messaging.ts @@ -34,6 +34,15 @@ class ContactListComponent if (!ContactService.getContact(message.message.from)) { let newContact = { did: message.message.from } ContactService.addContact(newContact as Contact) + let msgToSave = { + raw: message.message, + type: message.message.type, + sender: newContact.did, + receiver: message.receiver?.label || message.receiver.did, + timestamp: new Date(), + content: message.message.body?.content + }; + ContactService.addMessage(newContact.did, msgToSave) if ( message.message.type != "https://didcomm.org/user-profile/1.0/profile" ) {