fix: split view with a few messages appeared sticky at the top

pull/3281/head
Audric Ackermann 5 months ago
parent 6036c6c918
commit 3ee69437b0
No known key found for this signature in database

@ -11,6 +11,7 @@ const StyledSplitView = styled.div`
max-height: 100%;
min-height: 0;
display: flex;
flex-grow: 1;
flex-direction: column;
`;

@ -166,7 +166,7 @@ class ConvoController {
public getNicknameOrRealUsernameOrPlaceholder(pubKey: string): string {
const conversation = ConvoHub.use().get(pubKey);
if (!conversation) {
return pubKey;
return PubKey.shorten(pubKey);
}
return conversation.getNicknameOrRealUsernameOrPlaceholder();
}

@ -88,7 +88,7 @@ export class PubKey {
const pk = value instanceof PubKey ? valAny.key : value;
if (!pk || pk.length < 8) {
throw new Error('PubKey.shorten was given an invalid PubKey to shorten.');
return pk;
}
return `(${pk.substring(0, 4)}...${pk.substring(pk.length - 4)})`;

Loading…
Cancel
Save