SHA256
Исправить отображение версий в дневнике и тредах
This commit is contained in:
@@ -24,6 +24,7 @@ import { loadProfileSnapshot } from '../services/user-profile-params.js';
|
||||
import { extractLoginFromBlockchainName, makeProfileRoute, makeShineChannelRoute, makeShineMessageRoute } from '../services/shine-routes.js';
|
||||
|
||||
export const pageMeta = { id: 'channel-thread-view', title: 'Тред' };
|
||||
const MSG_SUBTYPE_TEXT_POST = 10;
|
||||
const MSG_SUBTYPE_TEXT_RATING = 30;
|
||||
const MSG_SUBTYPE_TEXT_ENTRYPOINT = 100;
|
||||
const MSG_SUBTYPE_TEXT_EXERCISE = 110;
|
||||
@@ -247,6 +248,13 @@ function getChannelMessageTypeMeta(msgSubType) {
|
||||
}
|
||||
}
|
||||
|
||||
function isEditableAsChannelPostSubType(msgSubType) {
|
||||
return Number(msgSubType || 0) === MSG_SUBTYPE_TEXT_POST
|
||||
|| Number(msgSubType || 0) === MSG_SUBTYPE_TEXT_EXERCISE
|
||||
|| Number(msgSubType || 0) === MSG_SUBTYPE_TEXT_SERVICE
|
||||
|| Number(msgSubType || 0) === MSG_SUBTYPE_TEXT_COURSE;
|
||||
}
|
||||
|
||||
function extractChannelContextFromThreadPayload(payload) {
|
||||
const focusInfo = payload?.focus?.channelInfo;
|
||||
if (focusInfo?.ownerBlockchainName && focusInfo?.channelRoot?.blockNumber != null) {
|
||||
@@ -455,10 +463,10 @@ function openBlockchainDetailsModal(details) {
|
||||
|
||||
function resolveNodeText(node) {
|
||||
return firstNonEmptyText(
|
||||
latestVersionText(node?.versions),
|
||||
node?.text,
|
||||
node?.message,
|
||||
node?.body,
|
||||
latestVersionText(node?.versions),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -751,8 +759,8 @@ function renderNodeCard(node, heading, handlers, localNumber) {
|
||||
const replies = Number(node?.repliesCount || 0);
|
||||
const ratings = Number(node?.ratingsCount || 0);
|
||||
const isOwnMessage = String(node?.authorLogin || '').trim().toLowerCase() === String(state.session.login || '').trim().toLowerCase();
|
||||
const isChannelPost = Number(node?.channelInfo?.channelRoot?.blockNumber) >= 0;
|
||||
const msgSubType = Number(node?.msgSubType || 0);
|
||||
const isChannelPost = isEditableAsChannelPostSubType(msgSubType);
|
||||
const isRating = msgSubType === MSG_SUBTYPE_TEXT_RATING;
|
||||
const repostTarget = msgSubType === 50 ? buildRepostTargetFromNode(node) : null;
|
||||
const parsedText = parseMessageAttachments(text);
|
||||
|
||||
Reference in New Issue
Block a user