Avatar: Fix channel avatar animation (#6058)

This commit is contained in:
zubiden 2025-07-14 02:49:19 +02:00 committed by Alexander Zinchuk
parent f32d327622
commit 22fc02abbb
4 changed files with 10 additions and 18 deletions

View File

@ -218,20 +218,13 @@
transition: transform 0.2s ease, opacity 0.2s ease;
&.transition-circle {
transition: transform 0.2s ease, opacity 0.2s ease, border-radius 0.2s ease;
}
&.rounded-corners {
border-radius: var(--border-radius-messages);
}
&.circle {
border-radius: 50%;
}
body.is-ios & {
transition: transform 0.2s ease, opacity 0.2s ease, border-radius 0.2s ease !important;
transition: transform 0.2s ease, opacity 0.2s ease, border-radius 0.2s ease;
}
img,

View File

@ -172,11 +172,13 @@ const MediaViewerContent = ({
}
}
const textParts = textMessage && (textMessage.content.action?.type === 'suggestProfilePhoto'
? lang('Conversation.SuggestedPhotoTitle')
: renderMessageText({
message: textMessage, maxTimestamp, threadId, forcePlayback: true, isForMediaViewer: true,
}));
const textParts = textMessage && (
textMessage.content.action
? (textMessage.content.action.type === 'suggestProfilePhoto'
? lang('Conversation.SuggestedPhotoTitle') : undefined)
: renderMessageText({
message: textMessage, maxTimestamp, threadId, forcePlayback: true, isForMediaViewer: true,
}));
const buttonText = textMessage && 'buttonText' in textMessage ? textMessage.buttonText : undefined;
const hasFooter = Boolean(textParts);
const posterSize = calculateMediaViewerDimensions(dimensions!, hasFooter, isVideo);

View File

@ -371,7 +371,6 @@ function applyShape(ghost: HTMLDivElement, origin: MediaViewerOrigin) {
case MediaViewerOrigin.ScheduledInline:
case MediaViewerOrigin.StarsTransaction:
case MediaViewerOrigin.PreviewMedia:
case MediaViewerOrigin.ChannelAvatar:
ghost.classList.add('rounded-corners');
break;
@ -384,10 +383,8 @@ function applyShape(ghost: HTMLDivElement, origin: MediaViewerOrigin) {
case MediaViewerOrigin.MiddleHeaderAvatar:
case MediaViewerOrigin.SuggestedAvatar:
case MediaViewerOrigin.ChannelAvatar:
ghost.classList.add('circle');
if (origin === MediaViewerOrigin.SuggestedAvatar) {
ghost.classList.add('transition-circle');
}
break;
}
}

View File

@ -569,7 +569,7 @@ export function selectThreadIdFromMessage<T extends GlobalState>(global: T, mess
const chat = selectChat(global, message.chatId);
const { content } = message;
const { replyToMsgId, replyToTopId, isForumTopic } = getMessageReplyInfo(message) || {};
if ('action' in content && content.action?.type === 'topicCreate') {
if (content.action?.type === 'topicCreate') {
return message.id;
}