SHA256
CORE/CONTENT test5593 и адаптация UI
This commit is contained in:
@@ -213,8 +213,7 @@ async function resolveChannelSelector(route) {
|
||||
const ownerUser = await authService.getUser(ownerLogin);
|
||||
if (!ownerUser?.exists) throw new Error(t('screens.channel_about_view.text_025'));
|
||||
|
||||
const ownerFeed = await authService.listSubscriptionsFeed(ownerLogin, 500);
|
||||
const ownedRows = Array.isArray(ownerFeed?.ownedChannels) ? ownerFeed.ownedChannels : [];
|
||||
const ownedRows = (await authService.listOwnedChannelSummaries(ownerLogin, 500));
|
||||
const ownerLoginNormalized = ownerLogin.toLowerCase();
|
||||
const row = ownedRows.find((item) => (
|
||||
String(item?.channel?.channelName || '').trim().toLowerCase() === channelName.toLowerCase()
|
||||
|
||||
@@ -66,8 +66,7 @@ async function resolveChannelSelector(route) {
|
||||
if (!ownerUser?.exists) throw new Error(t('screens.channel_donate_view.text_015'));
|
||||
|
||||
const ownerBlockchainName = String(ownerUser.blockchainName || ownerRef).trim();
|
||||
const ownerFeed = await authService.listSubscriptionsFeed(ownerLogin, 500);
|
||||
const ownedRows = Array.isArray(ownerFeed?.ownedChannels) ? ownerFeed.ownedChannels : [];
|
||||
const ownedRows = (await authService.listOwnedChannelSummaries(ownerLogin, 500));
|
||||
const row = ownedRows.find((item) => (
|
||||
String(item?.channel?.channelName || '').trim().toLowerCase() === channelName.toLowerCase()
|
||||
&& String(item?.channel?.ownerBlockchainName || '').trim().toLowerCase() === ownerBlockchainName.toLowerCase()
|
||||
|
||||
@@ -320,8 +320,7 @@ async function resolveChannelDisplayNameFromServer(channelSelector) {
|
||||
if (!ownerLogin) return '';
|
||||
|
||||
try {
|
||||
const feed = await authService.listSubscriptionsFeed(ownerLogin, 1000);
|
||||
const rows = Array.isArray(feed?.ownedChannels) ? feed.ownedChannels : [];
|
||||
const rows = (await authService.listOwnedChannelSummaries(ownerLogin, 1000));
|
||||
const row = rows.find((item) => (
|
||||
String(item?.channel?.ownerBlockchainName || '').trim().toLowerCase() === ownerBch.toLowerCase()
|
||||
&& Number(item?.channel?.channelRoot?.blockNumber) === rootNo
|
||||
@@ -1444,9 +1443,8 @@ async function loadThreadData(sel, cacheKey, isCurrent) {
|
||||
}
|
||||
if (!channel && ownerLoginFromBch) {
|
||||
try {
|
||||
const ownerFeed = await authService.listSubscriptionsFeed(ownerLoginFromBch, 500);
|
||||
const ownerRows = (await authService.listOwnedChannelSummaries(ownerLoginFromBch, 500));
|
||||
if (!isCurrent()) return null;
|
||||
const ownerRows = Array.isArray(ownerFeed?.ownedChannels) ? ownerFeed.ownedChannels : [];
|
||||
channel = ownerRows.find((item) => (
|
||||
String(item?.channel?.ownerBlockchainName || '').trim().toLowerCase() === ownerNormalized
|
||||
&& String(item?.channel?.channelName || '').trim().toLowerCase() === channelNameNormalized
|
||||
|
||||
@@ -64,7 +64,7 @@ import {
|
||||
} from '../services/shine-routes.js';
|
||||
import { parseDmTechBlocks } from '../services/dm-tech-blocks.js';
|
||||
import { dropPageData, readPageData, writePageData } from '../services/page-data-cache.js';
|
||||
import { sortedChannelPublications } from '../services/channel-message-ordinals.js';
|
||||
import { sortedChannelPublications, canonicalReadPosts, readPrefixCount } from '../services/channel-message-ordinals.js';
|
||||
import { scrollNodeIntoContainer } from '../services/scroll-utils.js';
|
||||
|
||||
export const pageMeta = { id: 'channel-view', get title() { return t('screens.channel_view.text_001'); }, shellMode: { scrollbar: 'hidden', topFade: false, contentUnderTopbar: false, contentWidth: 'wide' } };
|
||||
@@ -316,27 +316,26 @@ function scrollChannelToUnreadLine(screen, unreadCount = 0, smooth = false) {
|
||||
function createChannelReadTracker({
|
||||
screen,
|
||||
routeKey,
|
||||
ownerBlockchainName,
|
||||
channelName,
|
||||
readSummary,
|
||||
posts,
|
||||
initializeIfMissing = false,
|
||||
unreadCount,
|
||||
messagesCount,
|
||||
initialSeenCount,
|
||||
onPersistError = null,
|
||||
onPersistSuccess = null,
|
||||
}) {
|
||||
const login = String(state.session.login || '').trim();
|
||||
const storagePwd = state.session.storagePwdInMemory;
|
||||
const cleanOwnerBlockchainName = String(ownerBlockchainName || '').trim();
|
||||
const cleanChannelName = String(channelName || '').trim();
|
||||
const orderedPosts = canonicalReadPosts(posts, readSummary);
|
||||
const rootRef = readSummary?.channel?.channelRoot;
|
||||
const missingWriteParts = [];
|
||||
if (!cleanOwnerBlockchainName) missingWriteParts.push('ownerBlockchainName');
|
||||
if (!cleanChannelName) missingWriteParts.push('channelName');
|
||||
if (!orderedPosts) missingWriteParts.push('CORE read prefix');
|
||||
if (!login) missingWriteParts.push('login');
|
||||
if (!storagePwd) missingWriteParts.push('storagePwd');
|
||||
const canWrite = missingWriteParts.length === 0;
|
||||
const safeMessagesCount = Math.max(0, Number(messagesCount || 0));
|
||||
const safeMessagesCount = orderedPosts?.length || 0;
|
||||
const safeInitialSeenCount = Math.max(0, Math.min(Number(initialSeenCount || 0), safeMessagesCount));
|
||||
const seenOrdinals = new Set();
|
||||
const unreadAnchorFraction = getUnreadAnchorViewportFraction(unreadCount);
|
||||
|
||||
let desiredSeenCount = safeInitialSeenCount;
|
||||
@@ -375,16 +374,19 @@ function createChannelReadTracker({
|
||||
|
||||
inFlight = true;
|
||||
try {
|
||||
const anchor = next === 0 ? rootRef : orderedPosts[next - 1].messageRef;
|
||||
const persisted = await authService.setChannelReadState({
|
||||
login,
|
||||
ownerBlockchainName: cleanOwnerBlockchainName,
|
||||
channelName: cleanChannelName,
|
||||
readCount: next,
|
||||
login, owner: readSummary.channel.ownerLogin, root: rootRef.blockNumber, rootHash: rootRef.blockHash,
|
||||
followHash: readSummary.followHash, anchor: anchor.blockNumber, anchorHash: anchor.blockHash,
|
||||
timeMs: Date.now(),
|
||||
storagePwd,
|
||||
});
|
||||
const serverReadCount = Math.max(0, Number(persisted?.read_count ?? next));
|
||||
const serverUnreadCount = Math.max(0, Number(persisted?.unread_count ?? Math.max(0, safeMessagesCount - serverReadCount)));
|
||||
if (disposed) return;
|
||||
if (persisted?.state?.followHash !== readSummary.followHash || !persisted.state.initialized || !Number.isInteger(persisted.state.readCount) || !Number.isInteger(persisted.state.unreadCount)) throw new Error('READ_STATE_RETRY');
|
||||
const serverReadCount = persisted.state.readCount;
|
||||
const serverUnreadCount = persisted.state.unreadCount;
|
||||
// A changed count can mean that the canonical prefix was replaced while the view was open.
|
||||
if (serverReadCount < persistedSeenCount || serverReadCount + serverUnreadCount !== safeMessagesCount) throw new Error('READ_STATE_RETRY');
|
||||
persistedSeenCount = Math.max(persistedSeenCount, Math.min(serverReadCount, safeMessagesCount));
|
||||
desiredSeenCount = Math.max(desiredSeenCount, persistedSeenCount);
|
||||
initialPersistPending = false;
|
||||
@@ -396,8 +398,9 @@ function createChannelReadTracker({
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
if (disposed) return;
|
||||
const errorCode = String(error?.code || '').trim().toUpperCase();
|
||||
if (errorCode === 'CHANNEL_NOT_FOLLOWED') {
|
||||
if (['CHANNEL_NOT_FOLLOWED','READ_ANCHOR_STALE','READ_STATE_RETRY','BAD_READ_STATE','BAD_TIME','BAD_SIGNATURE','LOGIN_MISMATCH','SESSION_NOT_FOUND','AUTH_REQUIRED','CHANNEL_NOT_FOUND','ACCOUNT_NOT_REGISTERED'].includes(errorCode || String(error?.message || ''))) {
|
||||
// This is a persistent state mismatch, not a transient transport failure.
|
||||
// Stop writes for the current channel view instead of hammering the server
|
||||
// after every scroll/resize. A fresh view after subscribe/refresh will create
|
||||
@@ -426,19 +429,14 @@ function createChannelReadTracker({
|
||||
const viewportHeight = root?.clientHeight || window.innerHeight || document.documentElement.clientHeight || 0;
|
||||
const thresholdTop = Math.max(0, Math.round(viewportHeight * unreadAnchorFraction));
|
||||
const visibleBottom = Math.max(thresholdTop, viewportHeight - 24);
|
||||
let seen = safeInitialSeenCount;
|
||||
if (!orderedPosts) return safeInitialSeenCount;
|
||||
for (const card of cards) {
|
||||
const localNumber = Number(card.dataset.localNumber || 0);
|
||||
if (!Number.isFinite(localNumber) || localNumber <= 0) continue;
|
||||
if (!Number.isInteger(localNumber) || localNumber <= 0) continue;
|
||||
const rect = card.getBoundingClientRect();
|
||||
if (rect.top > visibleBottom) break;
|
||||
if (rect.bottom < 0) {
|
||||
seen = Math.max(seen, localNumber);
|
||||
continue;
|
||||
}
|
||||
seen = Math.max(seen, localNumber);
|
||||
if (rect.top <= visibleBottom && rect.bottom > 0) seenOrdinals.add(localNumber);
|
||||
}
|
||||
return Math.max(safeInitialSeenCount, Math.min(seen, safeMessagesCount));
|
||||
return readPrefixCount(orderedPosts, persistedSeenCount, seenOrdinals);
|
||||
};
|
||||
|
||||
const measure = () => {
|
||||
@@ -1389,8 +1387,7 @@ async function loadFromApi(route, channelId) {
|
||||
const ownerLoginForLookup = routeOwnerLoginFromBch || (!looksLikeBlockchainName(routeOwnerRaw) ? routeOwnerRaw : '');
|
||||
if (ownerLoginForLookup) {
|
||||
try {
|
||||
const ownerFeed = await authService.listSubscriptionsFeed(ownerLoginForLookup, 500);
|
||||
const ownerRows = Array.isArray(ownerFeed?.ownedChannels) ? ownerFeed.ownedChannels : [];
|
||||
const ownerRows = await authService.listOwnedChannelSummaries(ownerLoginForLookup, 500);
|
||||
const ownerLoginNormalized = ownerLoginForLookup.toLowerCase();
|
||||
channel = ownerRows.find((item) => (
|
||||
String(item?.channel?.channelName || '').trim().toLowerCase() === selector.channelName.toLowerCase()
|
||||
@@ -1457,13 +1454,11 @@ async function loadFromApi(route, channelId) {
|
||||
|
||||
const payload = await authService.getChannelMessages(selector, null, 'asc', currentSessionLogin);
|
||||
const messages = Array.isArray(payload.messages) ? payload.messages : [];
|
||||
let reverseChannelMissingWarning = '';
|
||||
let mergedMessages = [...messages];
|
||||
const reverseChannelMissingWarning = '';
|
||||
const mergedMessages = [...messages];
|
||||
if (!messagesCount) messagesCount = mergedMessages.length;
|
||||
|
||||
const currentLogin = currentSessionLogin;
|
||||
const ownerLogin = String(payload.channel?.ownerLogin || '').trim();
|
||||
const channelName = String(payload.channel?.channelName || '').trim();
|
||||
const channelTypeCode = Number(payload.channel?.channelTypeCode ?? 1);
|
||||
// Channel-publication URLs are only unambiguous for public channels, not merged private chats.
|
||||
selector.channelName = String(payload.channel?.channelName || selector.channelName || '').trim();
|
||||
@@ -1472,46 +1467,24 @@ async function loadFromApi(route, channelId) {
|
||||
if (channelTypeCode === CHANNEL_TYPE_STORIES) {
|
||||
throw new Error(t('screens.channel_view.text_120'));
|
||||
}
|
||||
const canResolveReverse = (
|
||||
channelTypeCode === CHANNEL_TYPE_PERSONAL
|
||||
&& !!currentLogin
|
||||
&& !!ownerLogin
|
||||
&& !!channelName
|
||||
&& ownerLogin.toLowerCase() === currentLogin.toLowerCase()
|
||||
);
|
||||
|
||||
if (canResolveReverse) {
|
||||
const allRows = await getAllRows();
|
||||
const reverseSummary = allRows.find((item) => (
|
||||
Number(item?.channel?.channelTypeCode ?? 1) === CHANNEL_TYPE_PERSONAL
|
||||
&& String(item?.channel?.ownerLogin || '').trim().toLowerCase() === channelName.toLowerCase()
|
||||
&& String(item?.channel?.channelName || '').trim().toLowerCase() === currentLogin.toLowerCase()
|
||||
));
|
||||
|
||||
if (reverseSummary?.channel?.ownerBlockchainName && reverseSummary?.channel?.channelRoot?.blockNumber != null) {
|
||||
const reverseSelector = {
|
||||
ownerBlockchainName: String(reverseSummary.channel.ownerBlockchainName),
|
||||
channelRootBlockNumber: Number(reverseSummary.channel.channelRoot.blockNumber),
|
||||
channelRootBlockHash: normalizeRouteHash(reverseSummary.channel.channelRoot.blockHash),
|
||||
};
|
||||
const reversePayload = await authService.getChannelMessages(reverseSelector, null, 'asc', currentSessionLogin);
|
||||
const reverseMessages = Array.isArray(reversePayload?.messages) ? reversePayload.messages : [];
|
||||
mergedMessages = mergedMessages.concat(reverseMessages);
|
||||
} else {
|
||||
reverseChannelMissingWarning = t('screens.channel_view.text_145', { value1: channelName });
|
||||
}
|
||||
}
|
||||
|
||||
// The current server already merges both sides of PERSONAL channels.
|
||||
// Fetching and appending the reverse side again duplicates every post.
|
||||
const posts = sortedChannelPublications(
|
||||
mergedMessages.map((message, index) => mapApiMessageToPost(message, selector, index + 1)),
|
||||
).map((post, index) => ({ ...post, localNumber: index + 1 }));
|
||||
const isOwnChannel = ownerLogin.toLowerCase() === currentSessionLogin.toLowerCase();
|
||||
const followedRows = Array.isArray(state.channelsFeed?.followedChannels) ? state.channelsFeed.followedChannels : [];
|
||||
const isSubscribed = isAuthorized && followedRows.some((row) => (
|
||||
String(row?.channel?.ownerBlockchainName || '') === String(selector.ownerBlockchainName || '')
|
||||
const followedRows = isAuthorized ? (await ensureFeed())?.followedChannels || [] : [];
|
||||
const readSummary = followedRows.find(row =>
|
||||
String(row?.channel?.ownerBlockchainName || '').toLowerCase() === String(selector.ownerBlockchainName || '').toLowerCase()
|
||||
&& Number(row?.channel?.channelRoot?.blockNumber) === Number(selector.channelRootBlockNumber)
|
||||
&& normalizeRouteHash(row?.channel?.channelRoot?.blockHash) === normalizeRouteHash(selector.channelRootBlockHash)
|
||||
));
|
||||
&& normalizeRouteHash(row?.channel?.channelRoot?.blockHash) === normalizeRouteHash(selector.channelRootBlockHash));
|
||||
const isSubscribed = !!readSummary;
|
||||
if (readSummary) {
|
||||
unreadCount = Number(readSummary.unreadCount || 0);
|
||||
messagesCount = Number(readSummary.messagesCount || 0);
|
||||
readCount = Number(readSummary.readCount || 0);
|
||||
readStateInitialized = !!readSummary.readStateInitialized;
|
||||
}
|
||||
|
||||
return {
|
||||
channel: {
|
||||
@@ -1539,6 +1512,7 @@ async function loadFromApi(route, channelId) {
|
||||
isOwnChannel,
|
||||
isSubscribed,
|
||||
readStateInitialized,
|
||||
readSummary,
|
||||
selector,
|
||||
};
|
||||
}
|
||||
@@ -2306,7 +2280,9 @@ function renderBody(screen, navigate, routeKey, channelData, handlers) {
|
||||
const postsByKey = new Map();
|
||||
const metaEvents = (Array.isArray(channelData.metaEvents) ? channelData.metaEvents : [])
|
||||
.map((event) => mapChannelMetaEvent(event, channelData.channel));
|
||||
let unreadLineInserted = unreadCount === 0;
|
||||
const canonicalPosts = canonicalReadPosts(channelData.posts, channelData.readSummary);
|
||||
const unreadOrdinals = canonicalPosts ? new Set(canonicalPosts.slice(readCount).map(post => post.localNumber)) : null;
|
||||
let unreadLineInserted = unreadCount === 0 || !unreadOrdinals;
|
||||
const feedItems = [
|
||||
...metaEvents.map((event) => ({
|
||||
type: 'meta',
|
||||
@@ -2339,7 +2315,7 @@ function renderBody(screen, navigate, routeKey, channelData, handlers) {
|
||||
separator.innerHTML = `<span>${escapeHtml(formatDayLabel(item.timestampMs))}</span>`;
|
||||
feed.append(separator);
|
||||
}
|
||||
if (!unreadLineInserted && item.type === 'post' && Number(item?.post?.localNumber || 0) > readCount) {
|
||||
if (!unreadLineInserted && item.type === 'post' && unreadOrdinals?.has(item.post.localNumber)) {
|
||||
const unreadLine = document.createElement('div');
|
||||
unreadLine.className = 'card channel-unread-line';
|
||||
unreadLine.textContent = t('dialogs.modals.channel_view.label_055');
|
||||
@@ -2426,17 +2402,17 @@ function renderBody(screen, navigate, routeKey, channelData, handlers) {
|
||||
channelData.isSubscribed
|
||||
&& !channelData.isOwnChannel
|
||||
&& !channelData.isDiary
|
||||
&& !!channelData.readSummary?.followHash
|
||||
);
|
||||
|
||||
const tracker = shouldTrackReadState
|
||||
? createChannelReadTracker({
|
||||
screen,
|
||||
routeKey,
|
||||
ownerBlockchainName: channelData.channel?.ownerBlockchainName || channelData.selector?.ownerBlockchainName,
|
||||
channelName: channelData.channel?.name || channelData.channel?.channelName,
|
||||
readSummary: channelData.readSummary,
|
||||
posts: channelData.posts,
|
||||
initializeIfMissing: !!(!channelData.readStateInitialized),
|
||||
unreadCount,
|
||||
messagesCount,
|
||||
initialSeenCount: readCount,
|
||||
onPersistError: (error, options = {}) => {
|
||||
const detail = String(error?.message || '').trim();
|
||||
@@ -2678,19 +2654,8 @@ export function render({ navigate, route, chrome }) {
|
||||
});
|
||||
if (disposed) return;
|
||||
|
||||
try {
|
||||
await authService.setChannelReadState({
|
||||
login,
|
||||
ownerBlockchainName: apiData.channel?.ownerBlockchainName || apiData.selector?.ownerBlockchainName,
|
||||
channelName: apiData.channel?.name || apiData.channel?.channelName,
|
||||
readCount: Math.max(0, Number(apiData.messagesCount || 0)),
|
||||
timeMs: Date.now(),
|
||||
storagePwd,
|
||||
});
|
||||
} catch (readStateError) {
|
||||
showStatus(toUserMessage(readStateError, t('screens.channel_view.text_058')));
|
||||
}
|
||||
|
||||
// Refresh the signed subscription identity; the viewport tracker initializes
|
||||
// the root and advances only over the actually seen canonical prefix.
|
||||
const feed = await authService.listSubscriptionsFeed(login, 200);
|
||||
if (disposed) return;
|
||||
setChannelsFeed(feed, state.channelsIndex);
|
||||
|
||||
@@ -186,8 +186,7 @@ async function resolveChannelTargetFromInput(rawInput) {
|
||||
throw new Error(t('screens.channels_list.text_030'));
|
||||
}
|
||||
|
||||
const ownerFeed = await authService.listSubscriptionsFeed(ownerLogin, 500);
|
||||
const ownChannels = Array.isArray(ownerFeed?.ownedChannels) ? ownerFeed.ownedChannels.filter(isVisibleChannelSummary) : [];
|
||||
const ownChannels = (await authService.listOwnedChannelSummaries(ownerLogin, 500)).filter(isVisibleChannelSummary);
|
||||
const matches = ownChannels.filter((item) => (
|
||||
String(item?.channel?.channelName || '').trim().toLowerCase() === channelName
|
||||
));
|
||||
|
||||
@@ -2,8 +2,7 @@ import { formatDateTime } from '../i18n/format.js';
|
||||
import { t, th } from '../i18n/index.js';
|
||||
import { createTopBar } from '../components/topbar.js';
|
||||
import { authService } from '../state.js';
|
||||
import { KeyRotationClient } from '../services/key-rotation-service.js';
|
||||
import { inspectBlockchainDataItem } from '../services/blockchain-entry-inspector.js';
|
||||
import { inspectCoreBlock } from '../services/blockchain-entry-inspector.js';
|
||||
import { makeProfileRoute, makeShineChannelRoute, makeShineMessageRoute } from '../services/shine-routes.js';
|
||||
import { actionErrorText } from '../services/ui-error-texts.js';
|
||||
|
||||
@@ -75,6 +74,7 @@ function shortHash(value) {
|
||||
}
|
||||
|
||||
function formatDate(ms) {
|
||||
if (ms == null) return '—';
|
||||
try {
|
||||
return formatDateTime(new Date(Number(ms) || 0));
|
||||
} catch {
|
||||
@@ -145,10 +145,10 @@ function lineTextKindLabel(subType) {
|
||||
}
|
||||
|
||||
function describeEntry(item, inspection, channelNames) {
|
||||
if (!inspection?.frame) {
|
||||
if (!inspection?.frame || inspection.frame.type == null || inspection.contentStatus !== 'VALID') {
|
||||
return {
|
||||
title: t('screens.my_blockchain_view.text_075', { value1: item.msgType, value2: item.msgSubType }),
|
||||
detailTitle: t('screens.my_blockchain_view.text_076', { value1: item.msgType, value2: item.msgSubType }),
|
||||
title: 'CORE',
|
||||
detailTitle: inspection?.contentStatus ? `CONTENT: ${inspection.contentStatus}` : 'CORE',
|
||||
text: '',
|
||||
attachmentsCount: 0,
|
||||
};
|
||||
@@ -436,17 +436,19 @@ function createEntryCard({ item, inspection, parseError, channelNames, blockchai
|
||||
|
||||
const info = document.createElement('div');
|
||||
info.className = 'my-blockchain-entry__detail-grid';
|
||||
const effectiveType = frame ? `${frame.type}/${frame.subType} · v${frame.version}` : `${item.msgType}/${item.msgSubType} · v${item.msgVersion}`;
|
||||
const effectiveType = frame && frame.type != null && inspection?.contentStatus === 'VALID' ? `${frame.type}/${frame.subType} · v${frame.version}` : '—';
|
||||
addDetailRow(info, t('screens.my_blockchain_view.text_016'), effectiveType);
|
||||
addDetailRow(info, t('screens.my_blockchain_view.text_017'), `#${item.blockNumber}`);
|
||||
addDetailRow(info, t('screens.my_blockchain_view.text_018'), formatDate(item.timestampMs));
|
||||
addDetailRow(info, t('screens.my_blockchain_view.text_019'), item.blockHash, { code: true });
|
||||
if (inspection?.dataItemId) addDetailRow(info, 'DataItem ID', inspection.dataItemId, { code: true });
|
||||
if (inspection?.dataItemId) addDetailRow(info, 'CORE DataItem ID', inspection.dataItemId, { code: true });
|
||||
if (inspection?.contentDataItemId) addDetailRow(info, 'CONTENT DataItem ID', inspection.contentDataItemId, { code: true });
|
||||
if (inspection?.contentStatus) addDetailRow(info, 'CONTENT', inspection.contentStatus);
|
||||
|
||||
const body = frame?.body || {};
|
||||
if (body.line) {
|
||||
if (Number.isInteger(Number(body.line.lineCode))) addDetailRow(info, t('screens.my_blockchain_view.text_020'), `#${body.line.lineCode}`);
|
||||
if (Number.isInteger(Number(body.line.lineSequence))) addDetailRow(info, t('screens.my_blockchain_view.text_021'), body.line.lineSequence);
|
||||
if (Number.isInteger(body.line.lineSequence)) addDetailRow(info, t('screens.my_blockchain_view.text_021'), body.line.lineSequence);
|
||||
}
|
||||
if (body.kind === 'profile') {
|
||||
addDetailRow(info, t('screens.my_blockchain_view.text_022'), body.key);
|
||||
@@ -526,7 +528,6 @@ export function render({ navigate, chrome }, { historyOnly = false } = {}) {
|
||||
more.hidden = true;
|
||||
screen.append(more);
|
||||
|
||||
const client = new KeyRotationClient(authService);
|
||||
const channelNames = new Map([[0, 'stories']]);
|
||||
let channelsLoaded = false;
|
||||
let before = null;
|
||||
@@ -561,7 +562,7 @@ export function render({ navigate, chrome }, { historyOnly = false } = {}) {
|
||||
before = null;
|
||||
}
|
||||
try {
|
||||
const data = await client.getMyBlockchain({ beforeBlock: before, limit: 50, includeBlockBytes: true });
|
||||
const data = await authService.getMyBlockchainPage({ beforeBlock: before, limit: 50, includeBlockBytes: true });
|
||||
if (disposed || seq !== loadSeq) return;
|
||||
await ensureChannelNames(String(data.login || '').trim());
|
||||
if (disposed || seq !== loadSeq) return;
|
||||
@@ -574,9 +575,11 @@ export function render({ navigate, chrome }, { historyOnly = false } = {}) {
|
||||
}
|
||||
|
||||
const rows = await Promise.all((data.blocks || []).map(async (item) => {
|
||||
if (!item?.blockBytesB64) return { item, inspection: null, parseError: t('screens.my_blockchain_view.text_066') };
|
||||
item = { ...item, blockHash: item.coreHash };
|
||||
if (!item?.coreDataItemB64) return { item, inspection: null, parseError: t('screens.my_blockchain_view.text_066') };
|
||||
try {
|
||||
const inspection = await inspectBlockchainDataItem(item.blockBytesB64);
|
||||
const inspection = await inspectCoreBlock(item);
|
||||
item = { ...item, blockHash: item.coreHash, timestampMs: inspection.frame.timestampMs, msgType: inspection.frame.type, msgSubType: inspection.frame.subType, msgVersion: inspection.frame.version };
|
||||
const body = inspection?.frame?.body;
|
||||
if (inspection?.frame?.type === 0 && inspection?.frame?.subType === 1) {
|
||||
const root = Number(inspection.frame.blockNumber);
|
||||
|
||||
@@ -32,7 +32,7 @@ import { getNamespace, normalizeFullLogin } from '../services/shine-namespace-se
|
||||
import { calculateRegistrationFunding, USER_PDA_SPACE, solFromLamports } from '../services/registration-upgrade-helpers.js';
|
||||
|
||||
export const pageMeta = { id: 'registration-payment-view', get title() { return t('screens.registration_payment_view.text_001'); }, showAppChrome: false };
|
||||
const TEST_TOPUP_AMOUNT_SOL = 0.032;
|
||||
const TEST_TOPUP_AMOUNT_SOL = 0.04;
|
||||
const DEVNET_ENDPOINT = 'https://api.devnet.solana.com';
|
||||
const TEST_TOPUP_SENDER_PRIVATE_32_BASE58 = '6xqAuKYvA8qrCdAkcw7Y8aMgvBnYk8JLxWLma5BzbAvu';
|
||||
const AUTO_LOGIN_INITIAL_DELAY_MS = 1000;
|
||||
@@ -750,7 +750,7 @@ function renderSolanaDoneStage({ navigate, status, keyBundle, registrationTxId =
|
||||
}, AUTO_LOGIN_INITIAL_DELAY_MS);
|
||||
}
|
||||
|
||||
/** Тот же тестовый источник +0.032 devnet SOL, что используется обычной регистрацией.
|
||||
/** Тот же тестовый источник +0.04 devnet SOL, что используется обычной регистрацией.
|
||||
* Экспорт добавлен для FREE_CERT → Solana upgrade; поведение обычной регистрации не изменяется.
|
||||
* Никогда не используйте этот встроенный devnet-кошелёк для реальных средств.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user