Fix splitting peer title
This commit is contained in:
parent
804757efe0
commit
207004c889
@ -520,7 +520,7 @@ export default class AppSelectPeers {
|
||||
div.dataset.key = '' + peerId;
|
||||
if(typeof(peerId) === 'number') {
|
||||
if(title === undefined) {
|
||||
title = new PeerTitle({peerId, onlyFirstName: true, dialog: true}).element;
|
||||
title = new PeerTitle({peerId, dialog: true}).element;
|
||||
}
|
||||
|
||||
avatarEl.setAttribute('peer', '' + peerId);
|
||||
|
@ -48,10 +48,7 @@ export default class ChatAudio extends PinnedContainer {
|
||||
let title: string | HTMLElement, subtitle: string;
|
||||
const message = appMessagesManager.getMessageByPeer(peerId, mid);
|
||||
if(doc.type === 'voice' || doc.type === 'round') {
|
||||
title = new PeerTitle({
|
||||
peerId: message.fromId,
|
||||
onlyFirstName: true
|
||||
}).element;
|
||||
title = new PeerTitle({peerId: message.fromId}).element;
|
||||
|
||||
//subtitle = 'Voice message';
|
||||
subtitle = formatDate(message.date, false, false);
|
||||
|
@ -13,10 +13,7 @@ import PopupPeer, { PopupPeerButtonCallbackCheckboxes, PopupPeerOptions } from "
|
||||
|
||||
export default class PopupDeleteDialog {
|
||||
constructor(peerId: number, peerType: PeerType = appPeersManager.getDialogType(peerId), onSelect?: (promise: Promise<any>) => void) {
|
||||
const peerTitleElement = new PeerTitle({
|
||||
peerId,
|
||||
onlyFirstName: true
|
||||
}).element;
|
||||
const peerTitleElement = new PeerTitle({peerId}).element;
|
||||
|
||||
/* const callbackFlush = (checked: PopupPeerButtonCallbackCheckboxes) => {
|
||||
const promise = appMessagesManager.flushHistory(peerId, checkboxes ? !checked[checkboxes[0].text] : undefined);
|
||||
@ -86,10 +83,7 @@ export default class PopupDeleteDialog {
|
||||
checkboxes = [{
|
||||
text: 'DeleteMessagesOptionAlso',
|
||||
textArgs: [
|
||||
new PeerTitle({
|
||||
peerId,
|
||||
onlyFirstName: true
|
||||
}).element
|
||||
new PeerTitle({peerId}).element
|
||||
]
|
||||
}];
|
||||
|
||||
|
@ -15,10 +15,7 @@ import PeerTitle from "../peerTitle";
|
||||
|
||||
export default class PopupDeleteMessages {
|
||||
constructor(peerId: number, mids: number[], type: ChatType, onConfirm?: () => void) {
|
||||
const peerTitleElement = new PeerTitle({
|
||||
peerId,
|
||||
onlyFirstName: true
|
||||
}).element;
|
||||
const peerTitleElement = new PeerTitle({peerId}).element;
|
||||
|
||||
mids = mids.slice();
|
||||
const callback = (checked: PopupPeerButtonCallbackCheckboxes, revoke?: boolean) => {
|
||||
|
@ -97,7 +97,7 @@ export default class PopupPinMessage {
|
||||
|
||||
checkboxes.push({
|
||||
text: 'PinAlsoFor',
|
||||
textArgs: [new PeerTitle({peerId, onlyFirstName: true}).element],
|
||||
textArgs: [new PeerTitle({peerId}).element],
|
||||
checked: true
|
||||
});
|
||||
}
|
||||
|
@ -379,7 +379,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
||||
div.dataset.key = '' + peerId;
|
||||
if(typeof(peerId) === 'number') {
|
||||
if(title === undefined) {
|
||||
title = new PeerTitle({peerId, onlyFirstName: true}).element;
|
||||
title = new PeerTitle({peerId}).element;
|
||||
}
|
||||
|
||||
avatarEl.setAttribute('peer', '' + peerId);
|
||||
|
@ -979,10 +979,7 @@ export default class AppSharedMediaTab extends SliderSuperTab {
|
||||
if(!isChannel) {
|
||||
checkboxes = [{
|
||||
text: 'AddOneMemberForwardMessages',
|
||||
textArgs: [new PeerTitle({
|
||||
peerId: peerIds[0],
|
||||
onlyFirstName: true
|
||||
}).element],
|
||||
textArgs: [new PeerTitle({peerId: peerIds[0]}).element],
|
||||
checked: true
|
||||
}];
|
||||
}
|
||||
|
@ -87,16 +87,16 @@ export class AppPeersManager {
|
||||
let title = '';
|
||||
if(peerId > 0) {
|
||||
if(peer.first_name) title += peer.first_name;
|
||||
if(peer.last_name) title += ' ' + peer.last_name;
|
||||
if(peer.last_name && (!onlyFirstName || !title)) title += ' ' + peer.last_name;
|
||||
|
||||
if(!title) title = peer.pFlags.deleted ? I18n.format('HiddenName', true) : peer.username;
|
||||
else title = title.trim();
|
||||
} else {
|
||||
title = peer.title;
|
||||
}
|
||||
|
||||
if(onlyFirstName) {
|
||||
title = title.split(' ')[0];
|
||||
if(onlyFirstName) {
|
||||
title = title.split(' ')[0];
|
||||
}
|
||||
}
|
||||
|
||||
return plainText ? title : RichTextProcessor.wrapEmojiText(title);
|
||||
|
@ -56,7 +56,7 @@
|
||||
background-color: var(--light-secondary-text-color);
|
||||
font-size: 16px;
|
||||
padding: 0 17px 0px 0px;
|
||||
line-height: 31px;
|
||||
line-height: 1.875rem;
|
||||
margin-left: -4px;
|
||||
margin-right: 12px;
|
||||
height: 32px;
|
||||
@ -65,7 +65,7 @@
|
||||
user-select: none;
|
||||
flex: 0 0 auto;
|
||||
transition: .2s opacity, .2s transform, .2s background-color;
|
||||
max-width: 10rem;
|
||||
max-width: 11.25rem;
|
||||
|
||||
@include text-overflow();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user