SHA256
HEADER v3, primary аккаунты и подтверждения
This commit is contained in:
@@ -6,6 +6,7 @@ import { appendShineMessageLinks } from '../services/shine-message-links.js';
|
||||
import { confirmDialog } from '../components/confirm-dialog.js';
|
||||
import { openBlockchainDetailsModal } from '../components/blockchain-details-dialog.js';
|
||||
import { confirmLikeAction, showLikeStatistics } from '../components/like-action-sheet.js';
|
||||
import { publicLikeCount, hasLikeStatistics } from '../services/public-like-count.js';
|
||||
import { iconHtml } from '../components/ui-icon.js';
|
||||
import { consumeReplyEditorOnOpen, rememberChannelPosition, readChannelPosition, restoreChannelPosition } from '../services/channel-view-state.js';
|
||||
import { attachMessageMenu } from '../components/message-menu.js';
|
||||
@@ -624,9 +625,7 @@ function renderNodeCard(node, heading, handlers, localNumber, { focusPost = fals
|
||||
const versions = Array.isArray(node?.versions) ? node.versions : [];
|
||||
const versionsTotal = Number(node?.versionsTotal || versions.length || 1);
|
||||
const text = resolveNodeText(node) || (versionsTotal > 1 ? t('screens.channel_thread_view.text_060') : t('screens.channel_thread_view.text_061'));
|
||||
const likes = Number(node?.likesCount || 0);
|
||||
const primaryLikes = Number(node?.primaryLikesCount || 0);
|
||||
const shiningLikes = Number(node?.shiningLikesCount || 0);
|
||||
const likes = publicLikeCount(node);
|
||||
const replies = replyCountOf(node);
|
||||
const ratings = Number(node?.ratingsCount || 0);
|
||||
const isOwnMessage = Boolean(state.session.isAuthorized && state.session.login) && String(node?.authorLogin || '').trim().toLowerCase() === String(state.session.login).trim().toLowerCase();
|
||||
@@ -836,7 +835,7 @@ function renderNodeCard(node, heading, handlers, localNumber, { focusPost = fals
|
||||
const likesStatsButton = document.createElement('button');
|
||||
likesStatsButton.type = 'button';
|
||||
likesStatsButton.className = 'ui-button channel-action-item channel-action-like-stats';
|
||||
likesStatsButton.textContent = String(Number(likes) || '');
|
||||
likesStatsButton.textContent = String(likes);
|
||||
likesStatsButton.setAttribute('aria-label', t('screens.channel_thread_view.text_103', { value1: likes }));
|
||||
likesStatsButton.addEventListener('click', (event) => {
|
||||
event.stopPropagation();
|
||||
@@ -920,8 +919,8 @@ function renderNodeCard(node, heading, handlers, localNumber, { focusPost = fals
|
||||
if (!REPOSTS_ENABLED) { notifyRepostSoon(); return; }
|
||||
void handlers.onRepost?.(target);
|
||||
});
|
||||
if (threadsLayout) actions.append(likeButton, ...(likes > 0 ? [likesStatsButton] : []), discussionButton, repostButton, shareButton);
|
||||
else actions.append(likeButton, ...(likes > 0 ? [likesStatsButton] : []), shareButton, discussionButton);
|
||||
if (threadsLayout) actions.append(likeButton, ...(hasLikeStatistics(node) ? [likesStatsButton] : []), discussionButton, repostButton, shareButton);
|
||||
else actions.append(likeButton, ...(hasLikeStatistics(node) ? [likesStatsButton] : []), shareButton, discussionButton);
|
||||
const supportBtn = document.createElement('button');
|
||||
supportBtn.type = 'button';
|
||||
supportBtn.className = 'ui-button channel-action-item channel-action-support';
|
||||
@@ -1169,7 +1168,7 @@ function renderComment({ node, parent, focus, channelOwner, handlers, nested = f
|
||||
|
||||
setMessageReactionState(target, node?.likedByMe === true ? 'liked' : 'unliked');
|
||||
const liked = getMessageReactionState(target) === 'liked';
|
||||
const likes = Number(node?.likesCount || 0);
|
||||
const likes = publicLikeCount(node);
|
||||
const like = document.createElement('button');
|
||||
like.type = 'button';
|
||||
like.className = `channel-action-item thread-comment__like${liked ? ' is-liked' : ''}`;
|
||||
@@ -1186,7 +1185,7 @@ function renderComment({ node, parent, focus, channelOwner, handlers, nested = f
|
||||
const commentLikeStats = document.createElement('button');
|
||||
commentLikeStats.type = 'button';
|
||||
commentLikeStats.className = 'channel-action-item thread-comment__like-count';
|
||||
commentLikeStats.textContent = String(likes || '');
|
||||
commentLikeStats.textContent = String(likes);
|
||||
commentLikeStats.setAttribute('aria-label', t('screens.channel_thread_view.text_107', { value1: likes }));
|
||||
commentLikeStats.addEventListener('click', () => { void showLikeStatistics({ counts: node }); });
|
||||
|
||||
@@ -1247,7 +1246,7 @@ function renderComment({ node, parent, focus, channelOwner, handlers, nested = f
|
||||
repost.addEventListener('click', () => (REPOSTS_ENABLED ? handlers.onRepost?.(target) : notifyRepostSoon()));
|
||||
|
||||
// Ряд действий как у записи канала: лайк, ответы, репост, поделиться.
|
||||
actions.append(like, ...(likes > 0 ? [commentLikeStats] : []), reply, repost, share);
|
||||
actions.append(like, ...(hasLikeStatistics(node) ? [commentLikeStats] : []), reply, repost, share);
|
||||
const supportBtn = document.createElement('button');
|
||||
supportBtn.type = 'button';
|
||||
supportBtn.className = 'channel-action-item thread-comment__support';
|
||||
|
||||
Reference in New Issue
Block a user