From 839b8ca96b01d840aaba781b97907e55392e7fa7 Mon Sep 17 00:00:00 2001 From: "Colton Wolkins (Laptop)" Date: Fri, 5 Jan 2024 15:48:48 -0700 Subject: [PATCH 1/2] fix: don't expand elements when label is did Signed-off-by: Colton Wolkins (Laptop) --- src/pages/profile/index.css | 3 +++ src/pages/profile/message.ts | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) 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}`)), ] From b7b53032aadd33a1c813db0e109c9790e3d8a723 Mon Sep 17 00:00:00 2001 From: "Colton Wolkins (Laptop)" Date: Fri, 5 Jan 2024 15:50:05 -0700 Subject: [PATCH 2/2] fix: Store first message received Signed-off-by: Colton Wolkins (Laptop) --- src/pages/profile/messaging.ts | 9 +++++++++ 1 file changed, 9 insertions(+) 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" ) {