Message: Fix incorrect meta position on channel posts (#4312)

This commit is contained in:
Alexander Zinchuk 2024-03-01 14:02:39 -05:00
parent a11db94e34
commit 0eecca4fb9
5 changed files with 11 additions and 9 deletions

View File

@ -1011,7 +1011,7 @@ export async function fetchMessageViews({
})) }))
))); )));
if (!results || results.find((result) => !result)) return undefined; if (!results || results.some((result) => !result)) return undefined;
const viewsList = results.flatMap((result) => result!.views); const viewsList = results.flatMap((result) => result!.views);
const users = results.flatMap((result) => result!.users); const users = results.flatMap((result) => result!.users);

View File

@ -692,7 +692,7 @@ const Message: FC<OwnProps & StateProps> = ({
asForwarded, asForwarded,
hasThread: hasThread && !noComments, hasThread: hasThread && !noComments,
forceSenderName, forceSenderName,
hasComments: repliesThreadInfo && repliesThreadInfo.messagesCount > 0, hasCommentCounter: hasThread && repliesThreadInfo.messagesCount > 0,
hasActionButton: canForward || canFocus, hasActionButton: canForward || canFocus,
hasReactions, hasReactions,
isGeoLiveActive: location?.type === 'geoLive' && !isGeoLiveExpired(message), isGeoLiveActive: location?.type === 'geoLive' && !isGeoLiveExpired(message),

View File

@ -682,7 +682,7 @@
flex-wrap: wrap; flex-wrap: wrap;
align-items: flex-end; align-items: flex-end;
&.has-comments { &.has-comment-counter {
min-height: 5.25rem; min-height: 5.25rem;
margin-top: 0 !important; margin-top: 0 !important;

View File

@ -12,7 +12,7 @@ export function buildContentClassName(
asForwarded, asForwarded,
hasThread, hasThread,
forceSenderName, forceSenderName,
hasComments, hasCommentCounter,
hasActionButton, hasActionButton,
hasReactions, hasReactions,
isGeoLiveActive, isGeoLiveActive,
@ -25,7 +25,7 @@ export function buildContentClassName(
asForwarded?: boolean; asForwarded?: boolean;
hasThread?: boolean; hasThread?: boolean;
forceSenderName?: boolean; forceSenderName?: boolean;
hasComments?: boolean; hasCommentCounter?: boolean;
hasActionButton?: boolean; hasActionButton?: boolean;
hasReactions?: boolean; hasReactions?: boolean;
isGeoLiveActive?: boolean; isGeoLiveActive?: boolean;
@ -69,8 +69,8 @@ export function buildContentClassName(
classNames.push('round'); classNames.push('round');
} }
if (hasComments) { if (hasCommentCounter) {
classNames.push('has-comments'); classNames.push('has-comment-counter');
} }
} }
if (isMedia) { if (isMedia) {
@ -133,7 +133,7 @@ export function buildContentClassName(
if (!isCustomShape) { if (!isCustomShape) {
classNames.push('has-shadow'); classNames.push('has-shadow');
if (isMedia && hasComments) { if (isMedia && hasThread) {
classNames.push('has-background'); classNames.push('has-background');
} }

View File

@ -1849,7 +1849,9 @@ addActionHandler('loadMessageViews', async (global, actions, payload): Promise<v
forwardsCount: update.forwards, forwardsCount: update.forwards,
}); });
global = updateThreadInfo(global, chatId, update.id, update.threadInfo); if (update.threadInfo) {
global = updateThreadInfo(global, chatId, update.id, update.threadInfo);
}
}); });
setGlobal(global); setGlobal(global);