SHA256
Исправить автоскролл и TDZ в канале
This commit is contained in:
@@ -1255,6 +1255,8 @@ function mapApiMessageToPost(message, selector, localNumber) {
|
|||||||
async function loadFromApi(route, channelId) {
|
async function loadFromApi(route, channelId) {
|
||||||
const currentSessionLogin = String(state.session.login || '').trim();
|
const currentSessionLogin = String(state.session.login || '').trim();
|
||||||
const isAuthorized = !!currentSessionLogin;
|
const isAuthorized = !!currentSessionLogin;
|
||||||
|
let unreadCount = 0;
|
||||||
|
let messagesCount = 0;
|
||||||
let cachedFeed = null;
|
let cachedFeed = null;
|
||||||
const ensureFeed = async () => {
|
const ensureFeed = async () => {
|
||||||
if (cachedFeed) return cachedFeed;
|
if (cachedFeed) return cachedFeed;
|
||||||
@@ -1315,6 +1317,9 @@ async function loadFromApi(route, channelId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (selector?.ownerBlockchainName && selector?.channelName) {
|
if (selector?.ownerBlockchainName && selector?.channelName) {
|
||||||
|
let unreadCount = 0;
|
||||||
|
let messagesCount = 0;
|
||||||
|
|
||||||
const routeOwnerRaw = String(selector.ownerBlockchainName || '').trim();
|
const routeOwnerRaw = String(selector.ownerBlockchainName || '').trim();
|
||||||
const routeOwnerNormalized = routeOwnerRaw.toLowerCase();
|
const routeOwnerNormalized = routeOwnerRaw.toLowerCase();
|
||||||
const routeOwnerLoginFromBch = extractLoginFromBlockchainName(routeOwnerRaw);
|
const routeOwnerLoginFromBch = extractLoginFromBlockchainName(routeOwnerRaw);
|
||||||
@@ -1382,8 +1387,7 @@ async function loadFromApi(route, channelId) {
|
|||||||
const messages = Array.isArray(payload.messages) ? payload.messages : [];
|
const messages = Array.isArray(payload.messages) ? payload.messages : [];
|
||||||
let reverseChannelMissingWarning = '';
|
let reverseChannelMissingWarning = '';
|
||||||
let mergedMessages = [...messages];
|
let mergedMessages = [...messages];
|
||||||
let unreadCount = 0;
|
if (!messagesCount) messagesCount = mergedMessages.length;
|
||||||
let messagesCount = mergedMessages.length;
|
|
||||||
|
|
||||||
const currentLogin = currentSessionLogin;
|
const currentLogin = currentSessionLogin;
|
||||||
const ownerLogin = String(payload.channel?.ownerLogin || '').trim();
|
const ownerLogin = String(payload.channel?.ownerLogin || '').trim();
|
||||||
@@ -2014,7 +2018,7 @@ function renderBody(screen, navigate, routeKey, channelData, handlers) {
|
|||||||
screen.append(feed, backButton);
|
screen.append(feed, backButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
applyPendingScroll(screen, routeKey, channelData.isOwnChannel || channelData.isDiary);
|
applyPendingScroll(screen, routeKey, channelData.isOwnChannel || channelData.isDiary || Number(channelData.unreadCount || 0) === 0);
|
||||||
return () => {
|
return () => {
|
||||||
// noop
|
// noop
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user