SHA256
Добавлен канал личных публикаций
This commit is contained in:
@@ -567,7 +567,8 @@ export function render({ navigate, route, chrome }) {
|
||||
};
|
||||
|
||||
const renderContent = ({ channel, selector, ownerUser, ownerProfile, isOwnChannel, isSubscribed }) => {
|
||||
const cleanName = String(channel?.displayTitle || channel?.displayName || channel?.channelName || t('dialogs.modals.channel_about_view.channel_fallback')).trim();
|
||||
const isRoot = Number(selector?.channelRootBlockNumber) === 0;
|
||||
const cleanName = isRoot && isOwnChannel ? t('remaining.channels.my_publications') : String(channel?.displayTitle || channel?.displayName || channel?.channelName || t('dialogs.modals.channel_about_view.channel_fallback')).trim();
|
||||
const ownerLogin = String(channel?.ownerLogin || extractLoginFromBlockchainName(selector?.ownerBlockchainName) || '').trim();
|
||||
const channelName = String(channel?.channelName || '').trim();
|
||||
const description = String(channel?.channelDescription || channel?.description || '').trim();
|
||||
@@ -603,7 +604,7 @@ export function render({ navigate, route, chrome }) {
|
||||
|
||||
<div class="channel-about-tiles">
|
||||
${cameFromChannel ? '' : `<button class="channel-about-tile" id="channel-about-open" type="button">${iconHtml('open')}<span>${th('screens.channel_about_view.text_035')}</span></button>`}
|
||||
${isOwnChannel ? `<button class="channel-about-tile" id="channel-about-edit" type="button">${iconHtml('edit')}<span>${th('screens.channel_about_view.text_036')}</span></button>` : ''}
|
||||
${isOwnChannel && !isRoot ? `<button class="channel-about-tile" id="channel-about-edit" type="button">${iconHtml('edit')}<span>${th('screens.channel_about_view.text_036')}</span></button>` : ''}
|
||||
${subscriptionTile}
|
||||
${isOwnChannel ? '' : `<button class="channel-about-tile" id="channel-about-support" type="button">${iconHtml('gift')}<span>${th('screens.channel_about_view.text_037')}</span></button>`}
|
||||
</div>
|
||||
@@ -624,7 +625,7 @@ export function render({ navigate, route, chrome }) {
|
||||
</span>
|
||||
<span class="channel-about-row-chevron">${iconHtml('chevron')}</span>
|
||||
</button>
|
||||
${isOwnChannel && !isDeleted ? `<button class="channel-about-row" id="channel-about-delete" type="button">
|
||||
${isOwnChannel && !isRoot && !isDeleted ? `<button class="channel-about-row" id="channel-about-delete" type="button">
|
||||
<span class="channel-about-row-main"><span class="channel-about-row-label">${th('screens.channel_about_view.text_038')}</span><span class="meta-muted">${th('screens.channel_about_view.text_039')}</span></span>
|
||||
<span class="channel-about-row-chevron" aria-hidden="true">${iconHtml('trash')}</span>
|
||||
</button>` : ''}
|
||||
@@ -738,6 +739,7 @@ export function render({ navigate, route, chrome }) {
|
||||
if (disposed || seq !== refreshSeq) return;
|
||||
|
||||
const channel = payload?.channel || {};
|
||||
if (Number(selector.channelRootBlockNumber) === 0 && channel.channelRoot?.blockHash) selector.channelRootBlockHash = normalizeHash(channel.channelRoot.blockHash);
|
||||
const ownerLogin = String(channel?.ownerLogin || extractLoginFromBlockchainName(selector.ownerBlockchainName) || '').trim();
|
||||
const currentLogin = String(state.session.login || '').trim();
|
||||
const isOwnChannel = Boolean(ownerLogin && currentLogin && ownerLogin.toLowerCase() === currentLogin.toLowerCase());
|
||||
@@ -753,10 +755,9 @@ export function render({ navigate, route, chrome }) {
|
||||
const ownerProfile = ownerProfileResult.status === 'fulfilled' ? ownerProfileResult.value : null;
|
||||
const feed = feedResult.status === 'fulfilled' ? feedResult.value : null;
|
||||
if (feed) setChannelsFeed(feed, state.channelsIndex);
|
||||
const followedRows = Array.isArray(feed?.followedChannels)
|
||||
? feed.followedChannels
|
||||
: (Array.isArray(state.channelsFeed?.followedChannels) ? state.channelsFeed.followedChannels : []);
|
||||
const isSubscribed = !isOwnChannel && followedRows.some((row) => isSelectorMatch(row, selector));
|
||||
const currentFeed = feed || state.channelsFeed || {};
|
||||
const followedRows = [...(currentFeed.followedUsersChannels || []), ...(currentFeed.followedChannels || [])];
|
||||
const isSubscribed = !isOwnChannel && followedRows.some((row) => isSelectorMatch(row, selector) || (Number(selector.channelRootBlockNumber) === 0 && Number(row?.channel?.channelRoot?.blockNumber) === 0 && String(row?.channel?.ownerLogin || '').toLowerCase() === ownerLogin.toLowerCase()));
|
||||
|
||||
renderContent({
|
||||
channel,
|
||||
|
||||
Reference in New Issue
Block a user