SHA256
Добавлена «Отправить через» в Android
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { shareForChat, finishShare, isShareSending, setShareSending } from '../services/share-flow.js';
|
||||
import { formatDate, formatDateTime } from '../i18n/format.js';
|
||||
import { t, th } from '../i18n/index.js';
|
||||
import { appendShineMessageLinks } from '../services/shine-message-links.js';
|
||||
@@ -1448,6 +1449,7 @@ function preserveComposerSelection(input, callback) {
|
||||
export function render({ navigate, route, chrome }) {
|
||||
const routeChatId = route.params.chatId || 'u1';
|
||||
const chatId = normalizeDmChatId(routeChatId) || 'u1';
|
||||
let shared = shareForChat(chatId);
|
||||
const contact = directMessages.find((d) => normalizeDmChatId(d.id) === chatId) || {
|
||||
id: chatId,
|
||||
name: String(routeChatId || chatId),
|
||||
@@ -1952,6 +1954,19 @@ export function render({ navigate, route, chrome }) {
|
||||
`;
|
||||
|
||||
const input = form.elements.message;
|
||||
const sharedBanner = document.createElement('div');
|
||||
sharedBanner.className = 'dm-edit-banner';
|
||||
sharedBanner.hidden = !shared?.files.length;
|
||||
if (shared) {
|
||||
input.value = shared.text;
|
||||
if (shared.files.length) {
|
||||
const description = document.createElement('div');
|
||||
description.className = 'dm-edit-banner__text';
|
||||
description.textContent = t('remaining.share.files', { count: shared.files.length }) + ': ' + shared.files.map(file => file.name).join(', ');
|
||||
sharedBanner.append(description);
|
||||
}
|
||||
}
|
||||
form.prepend(sharedBanner);
|
||||
const emojiSlot = form.querySelector('#chat-emoji-picker-slot');
|
||||
const emojiToggle = form.querySelector('#chat-emoji-toggle');
|
||||
const fileToggle = form.querySelector('#chat-file-toggle');
|
||||
@@ -2100,13 +2115,13 @@ export function render({ navigate, route, chrome }) {
|
||||
if (voiceBusy) mode = 'busy';
|
||||
else if (recording && voiceLocked) mode = 'stop';
|
||||
else if (recording) mode = 'voice';
|
||||
else if (activeEdit || String(input?.value || '').trim()) mode = 'send';
|
||||
else if (activeEdit || shared || String(input?.value || '').trim()) mode = 'send';
|
||||
|
||||
sendBtn.dataset.mode = mode;
|
||||
sendBtn.innerHTML = sendIconMarkup(mode);
|
||||
sendBtn.classList.toggle('is-recording', recording);
|
||||
sendBtn.classList.toggle('is-locked', recording && voiceLocked);
|
||||
sendBtn.disabled = voiceBusy || (mode === 'voice' && !recording && !fileTransferEnabled);
|
||||
sendBtn.disabled = isShareSending() || voiceBusy || (mode === 'voice' && !recording && !fileTransferEnabled);
|
||||
if (mode === 'send') {
|
||||
sendBtn.title = t('screens.chat_view.text_029');
|
||||
sendBtn.setAttribute('aria-label', t('dialogs.modals.chat_view.label_029'));
|
||||
@@ -2347,6 +2362,7 @@ export function render({ navigate, route, chrome }) {
|
||||
};
|
||||
|
||||
const startEditMode = (msg) => {
|
||||
if (shared) return;
|
||||
const base = parseBaseKey(msg?.baseKey);
|
||||
if (!base || msg?.from !== 'out') return;
|
||||
const parsed = parseDmTechBlocks(String(msg?.text || ''));
|
||||
@@ -2371,6 +2387,7 @@ export function render({ navigate, route, chrome }) {
|
||||
};
|
||||
|
||||
const startReplyMode = (msg) => {
|
||||
if (shared) return;
|
||||
const base = parseBaseKey(msg?.baseKey);
|
||||
if (!base) return;
|
||||
const parsed = parseDmTechBlocks(String(msg?.text || ''));
|
||||
@@ -2493,6 +2510,7 @@ export function render({ navigate, route, chrome }) {
|
||||
text: finalText,
|
||||
storagePwd: state.session.storagePwdInMemory,
|
||||
});
|
||||
if (shared && shareForChat(chatId) === shared) completeSharedDraft();
|
||||
markOutgoingSent(tempId, {
|
||||
messageKey: result?.outgoingKey || '',
|
||||
baseKey: result?.baseKey || result?.localBaseKey || '',
|
||||
@@ -2551,7 +2569,7 @@ export function render({ navigate, route, chrome }) {
|
||||
}
|
||||
showToast(actionErrorText(activeEdit ? t('screens.chat_view.text_070') : t('screens.chat_view.text_071'), e), {
|
||||
kind: 'error',
|
||||
action: { label: t('screens.chat_view.text_033'), onClick: () => { if (!disposed) form.requestSubmit(); } },
|
||||
action: { label: t('screens.chat_view.text_033'), onClick: () => { if (!disposed && !isShareSending()) form.requestSubmit(); } },
|
||||
});
|
||||
addAppLogEntry({
|
||||
level: 'warn',
|
||||
@@ -2566,7 +2584,7 @@ export function render({ navigate, route, chrome }) {
|
||||
}
|
||||
};
|
||||
|
||||
const sendFileAttachmentMessage = async (attachmentsInput) => {
|
||||
const sendFileAttachmentMessage = async (attachmentsInput, caption = '', onAccepted = null) => {
|
||||
const attachments = (Array.isArray(attachmentsInput) ? attachmentsInput : [attachmentsInput]).filter(Boolean);
|
||||
if (!attachments.length) return;
|
||||
if (attachments.length > DM_MAX_ATTACHMENTS_PER_MESSAGE) {
|
||||
@@ -2581,7 +2599,7 @@ export function render({ navigate, route, chrome }) {
|
||||
: (attachments.length === 1
|
||||
? `📎 ${String(attachments[0]?.name || 'file')}`
|
||||
: t('screens.chat_view.text_097', { value1: attachments.length }));
|
||||
const finalText = `${replyBlock}${fileBlocks}${fallbackText}`;
|
||||
const finalText = `${replyBlock}${fileBlocks}${sanitizeUserDmTextForSend(String(caption || '').trim()) || fallbackText}`;
|
||||
|
||||
hideUnreadSeparator({ rerender: false });
|
||||
const tempId = addOutgoingPendingMessage(chatId, finalText);
|
||||
@@ -2595,6 +2613,7 @@ export function render({ navigate, route, chrome }) {
|
||||
text: finalText,
|
||||
storagePwd: state.session.storagePwdInMemory,
|
||||
});
|
||||
onAccepted?.();
|
||||
markOutgoingSent(tempId, {
|
||||
messageKey: result?.outgoingKey || '',
|
||||
baseKey: result?.baseKey || result?.localBaseKey || '',
|
||||
@@ -2663,7 +2682,64 @@ export function render({ navigate, route, chrome }) {
|
||||
});
|
||||
};
|
||||
|
||||
function completeSharedDraft() {
|
||||
finishShare();
|
||||
shared = null;
|
||||
sharedBanner.hidden = true;
|
||||
input.value = '';
|
||||
input.readOnly = false;
|
||||
attachButtons.forEach(button => { button.disabled = false; });
|
||||
autoResizeComposer(input);
|
||||
syncComposerLayout();
|
||||
updateSendButtonMode();
|
||||
}
|
||||
|
||||
const sendSharedDraft = async (text) => {
|
||||
if (!shared || isShareSending()) return;
|
||||
const item = shared;
|
||||
const senderLogin = state.session.login;
|
||||
const senderSessionId = state.session.sessionId;
|
||||
const ensureSameSender = () => {
|
||||
if (!state.session.isAuthorized || senderLogin !== state.session.login || senderSessionId !== state.session.sessionId || shareForChat(chatId) !== item) throw new Error(t('remaining.share.error_session'));
|
||||
};
|
||||
if (item.files.length && !fileTransferEnabled) {
|
||||
showToast(t('screens.chat_view.text_054'), { kind: 'error' });
|
||||
return;
|
||||
}
|
||||
item.text = text;
|
||||
setShareSending(true);
|
||||
input.readOnly = true;
|
||||
attachButtons.forEach(button => { button.disabled = true; });
|
||||
updateSendButtonMode();
|
||||
try {
|
||||
ensureSameSender();
|
||||
if (!item.files.length) {
|
||||
await sendTextMessage(text);
|
||||
} else {
|
||||
// Retry only the not-yet-uploaded files; keep the draft until the DM is accepted.
|
||||
item.uploaded ||= [];
|
||||
for (let index = item.uploaded.length; index < item.files.length; index += 1) {
|
||||
ensureSameSender();
|
||||
const file = item.files[index];
|
||||
showToast(t('screens.chat_view.text_102', { value1: index + 1, value2: item.files.length, value3: file.name }), { kind: 'info', timeoutMs: 1200 });
|
||||
const attachment = await encryptAndUploadDmFile({ file, login: state.session.login, sessionId: state.session.sessionId, wsUrl: authService.serverUrl });
|
||||
item.uploaded.push(attachment);
|
||||
}
|
||||
ensureSameSender();
|
||||
await sendFileAttachmentMessage(item.uploaded, text, () => { if (shareForChat(chatId) === item) completeSharedDraft(); });
|
||||
}
|
||||
} catch (error) {
|
||||
showToast(actionErrorText(t('screens.chat_view.text_080'), error), { kind: 'error' });
|
||||
} finally {
|
||||
setShareSending(false);
|
||||
input.readOnly = false;
|
||||
attachButtons.forEach(button => { button.disabled = Boolean(shared); });
|
||||
updateSendButtonMode();
|
||||
}
|
||||
};
|
||||
|
||||
const handleSelectedFiles = async (fileList) => {
|
||||
if (shared) return;
|
||||
if (!fileTransferEnabled) {
|
||||
showToast(t('screens.chat_view.text_054'), { kind: 'error', timeoutMs: 1800 });
|
||||
return;
|
||||
@@ -2908,10 +2984,15 @@ export function render({ navigate, route, chrome }) {
|
||||
cancelReplyMode({ restoreDraft: true });
|
||||
});
|
||||
|
||||
if (shared) {
|
||||
attachButtons.forEach(button => { button.disabled = true; });
|
||||
input.readOnly = isShareSending();
|
||||
}
|
||||
autoResizeComposer(input);
|
||||
syncComposerLayout();
|
||||
updateSendButtonMode();
|
||||
input?.addEventListener('input', () => {
|
||||
if (shared) shared.text = input.value;
|
||||
rememberEmojiSelection();
|
||||
autoResizeComposer(input);
|
||||
syncComposerLayout();
|
||||
@@ -3057,12 +3138,16 @@ export function render({ navigate, route, chrome }) {
|
||||
input.addEventListener('keydown', (event) => {
|
||||
if (!isDmSendEnter(event)) return;
|
||||
event.preventDefault();
|
||||
if (String(input.value || '').trim()) form.requestSubmit();
|
||||
if (shared?.files.length || String(input.value || '').trim()) form.requestSubmit();
|
||||
});
|
||||
|
||||
form.addEventListener('submit', async (event) => {
|
||||
event.preventDefault();
|
||||
const text = String(input.value || '').trim();
|
||||
if (shared) {
|
||||
if (text || shared.files.length) await sendSharedDraft(text);
|
||||
return;
|
||||
}
|
||||
if (!text) return;
|
||||
input.value = '';
|
||||
autoResizeComposer(input);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { isShareChoosing, chooseShareRecipient } from '../services/share-flow.js';
|
||||
import { t } from '../i18n/index.js';
|
||||
// «Новый чат»: выбрать, кому написать. Пока поле пустое – свои близкие и друзья; при вводе –
|
||||
// сначала свои (мгновенно, на устройстве), затем вся сеть (по имени и логину). Нажатие
|
||||
@@ -28,6 +29,7 @@ function displayName(person) {
|
||||
export function render({ navigate, chrome }) {
|
||||
const screen = document.createElement('section');
|
||||
screen.className = 'stack dm-screen dm-search-screen';
|
||||
const sharing = isShareChoosing();
|
||||
let disposed = false;
|
||||
let searchTimer = 0;
|
||||
let searchSeq = 0;
|
||||
@@ -50,7 +52,12 @@ export function render({ navigate, chrome }) {
|
||||
const results = document.createElement('div');
|
||||
results.className = 'contact-search-results';
|
||||
|
||||
const openChat = (login) => navigate(`chat/${encodeURIComponent(normalizeDmChatId(login))}`);
|
||||
const openChat = (login) => {
|
||||
const chatId = normalizeDmChatId(login);
|
||||
const path = `chat/${encodeURIComponent(chatId).replace(/%40/gi, '@')}`;
|
||||
if (sharing) chooseShareRecipient(chatId, `/${path}`);
|
||||
navigate(path);
|
||||
};
|
||||
|
||||
function personRow(person, sub) {
|
||||
return createPersonRow({
|
||||
@@ -73,10 +80,10 @@ export function render({ navigate, chrome }) {
|
||||
const frag = document.createDocumentFragment();
|
||||
const ownMatches = mine.filter((person) => !query
|
||||
|| matchesPeopleQuery(`${displayName(person)} ${person.login} ${person.firstName} ${person.lastName}`, query));
|
||||
const ownShown = query ? ownMatches : ownMatches.filter((person) => person.relationFlag !== 'contact');
|
||||
const ownShown = query || sharing ? ownMatches : ownMatches.filter((person) => person.relationFlag !== 'contact');
|
||||
if (ownShown.length) {
|
||||
frag.append(createListSection(query ? t('screens.contact_search_view.text_015', { value1: ownShown.length }) : t('screens.contact_search_view.text_010')));
|
||||
ownShown.slice(0, query ? 50 : 40).forEach((person) => {
|
||||
ownShown.slice(0, sharing ? ownShown.length : (query ? 50 : 40)).forEach((person) => {
|
||||
const sub = [displayName(person) !== person.login ? `${person.login}` : '', RELATION_TEXT[person.relationFlag] || ''].filter(Boolean).join(' · ');
|
||||
frag.append(personRow(person, sub));
|
||||
});
|
||||
@@ -151,7 +158,7 @@ export function render({ navigate, chrome }) {
|
||||
for (const dialog of Array.isArray(payload?.dialogs) ? payload.dialogs : []) {
|
||||
const login = String(dialog?.peerLogin || '').trim();
|
||||
const relationFlag = String(dialog?.relationFlag || '').trim().toLowerCase();
|
||||
if (!login || !RELATION_TEXT[relationFlag] || byLogin.has(login.toLowerCase())) continue;
|
||||
if (!login || (!sharing && !RELATION_TEXT[relationFlag]) || byLogin.has(login.toLowerCase())) continue;
|
||||
byLogin.set(login.toLowerCase(), {
|
||||
login,
|
||||
relationFlag,
|
||||
@@ -160,7 +167,7 @@ export function render({ navigate, chrome }) {
|
||||
avatar: dialog?.avatar && typeof dialog.avatar === 'object' ? dialog.avatar : null,
|
||||
});
|
||||
}
|
||||
mine = [...byLogin.values()].sort((a, b) => (RELATION_ORDER[a.relationFlag] - RELATION_ORDER[b.relationFlag])
|
||||
mine = [...byLogin.values()].sort((a, b) => ((RELATION_ORDER[a.relationFlag] ?? 3) - (RELATION_ORDER[b.relationFlag] ?? 3))
|
||||
|| displayName(a).localeCompare(displayName(b), 'ru'));
|
||||
} catch {
|
||||
mine = [];
|
||||
@@ -169,7 +176,7 @@ export function render({ navigate, chrome }) {
|
||||
}
|
||||
|
||||
chrome?.setTopbar(createTopBar({
|
||||
title: t('screens.contact_search_view.text_006'),
|
||||
title: sharing ? t('remaining.share.choose') : t('screens.contact_search_view.text_006'),
|
||||
back: { onClick: () => navigate('messages-list') },
|
||||
}));
|
||||
screen.append(field, results);
|
||||
|
||||
@@ -58,7 +58,6 @@ export function render({ navigate, chrome }) {
|
||||
card,
|
||||
login,
|
||||
tilesHtml: [
|
||||
profileTileHtml({ icon: 'channels', label: t('remaining.channels.my_publications'), attrs: 'data-self-profile-action="publications"' }),
|
||||
profileTileHtml({ icon: 'edit', label: t('screens.profile_view.text_007'), attrs: 'data-self-profile-action="edit"' }),
|
||||
profileTileHtml({ icon: 'wallet', label: t('screens.profile_view.text_008'), attrs: 'data-self-profile-action="wallet"' }),
|
||||
profileTileHtml({ icon: 'settings', label: t('screens.profile_view.text_009'), attrs: 'data-self-profile-action="settings"' }),
|
||||
@@ -84,7 +83,6 @@ export function render({ navigate, chrome }) {
|
||||
const actionButton = event.target.closest('[data-self-profile-action]');
|
||||
if (actionButton) {
|
||||
const action = actionButton.dataset.selfProfileAction;
|
||||
if (action === 'publications') navigate(`SHiNE/${encodeURIComponent(card.login)}/stories`);
|
||||
if (action === 'edit') navigate('profile-edit-view');
|
||||
if (action === 'wallet') navigate('wallet-view');
|
||||
if (action === 'settings') navigate('settings-view');
|
||||
|
||||
@@ -29,10 +29,10 @@ import {
|
||||
} from '../services/solana-register-service.js';
|
||||
import { defaultServerLogin } from '../deploy-config.js';
|
||||
import { getNamespace, normalizeFullLogin } from '../services/shine-namespace-service.js';
|
||||
import { calculateRegistrationFunding, USER_PDA_SPACE, solFromLamports } from '../services/registration-upgrade-helpers.js';
|
||||
import { calculateRegistrationFunding, USER_PDA_SPACE, solFromLamports, UPGRADE_TEST_TOPUP_SOL } 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 = UPGRADE_TEST_TOPUP_SOL;
|
||||
const DEVNET_ENDPOINT = 'https://api.devnet.solana.com';
|
||||
const TEST_TOPUP_SENDER_PRIVATE_32_BASE58 = '6xqAuKYvA8qrCdAkcw7Y8aMgvBnYk8JLxWLma5BzbAvu';
|
||||
const AUTO_LOGIN_INITIAL_DELAY_MS = 1000;
|
||||
@@ -758,7 +758,7 @@ function renderSolanaDoneStage({ navigate, status, keyBundle, registrationTxId =
|
||||
}, AUTO_LOGIN_INITIAL_DELAY_MS);
|
||||
}
|
||||
|
||||
/** Тот же тестовый источник +0.032 devnet SOL, что используется обычной регистрацией.
|
||||
/** Тот же тестовый источник +0.4 devnet SOL, что используется обычной регистрацией.
|
||||
* Экспорт добавлен для FREE_CERT → Solana upgrade; поведение обычной регистрации не изменяется.
|
||||
* Никогда не используйте этот встроенный devnet-кошелёк для реальных средств.
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { loadUserProfileCard } from '../services/user-connections.js';
|
||||
import { formatChannelAddress } from '../services/shine-routes.js';
|
||||
import { t, th } from '../i18n/index.js';
|
||||
import { createTopBar } from '../components/topbar.js';
|
||||
@@ -48,6 +49,7 @@ export function render({ navigate, route, chrome }) {
|
||||
let activeKind = initialKind;
|
||||
const isFriendsScreen = initialKind === 'friends' || initialKind === 'close_friends';
|
||||
const isChannelsScreen = initialKind === 'channels_owned' || initialKind === 'channels_following';
|
||||
const isOwnedChannels = initialKind === 'channels_owned';
|
||||
let includeDeleted = false;
|
||||
let disposed = false;
|
||||
let rows = [];
|
||||
@@ -59,10 +61,22 @@ export function render({ navigate, route, chrome }) {
|
||||
body.className = 'profile-list-body';
|
||||
|
||||
chrome?.setTopbar(createTopBar({
|
||||
title: TITLES[initialKind] || t('screens.user_profile_list_view.text_015'),
|
||||
title: isOwnedChannels ? t('remaining.share.user_channels') : TITLES[initialKind] || t('screens.user_profile_list_view.text_015'),
|
||||
back: { onClick: () => navigateBack() },
|
||||
}));
|
||||
|
||||
if (isOwnedChannels) {
|
||||
const owner = document.createElement('div');
|
||||
owner.className = 'stack';
|
||||
const name = document.createElement('b'); name.textContent = login;
|
||||
const address = document.createElement('small'); address.className = 'meta-muted';
|
||||
owner.append(name, address); screen.append(owner);
|
||||
void loadUserProfileCard(login).then(card => {
|
||||
if (disposed) return;
|
||||
name.textContent = userDisplayName(card);
|
||||
address.textContent = name.textContent === login ? '' : login;
|
||||
}).catch(() => {});
|
||||
}
|
||||
if (isFriendsScreen) {
|
||||
const tabs = document.createElement('div');
|
||||
tabs.className = 'tabs profile-list-kind';
|
||||
@@ -148,19 +162,23 @@ export function render({ navigate, route, chrome }) {
|
||||
const text = document.createElement('div');
|
||||
text.className = 'profile-list-row-text';
|
||||
const title = document.createElement('b');
|
||||
title.textContent = `${String(row.displayName || row.slug || '')}${row.deleted ? t('screens.user_profile_list_view.text_013') : ''}`;
|
||||
title.textContent = `${isOwnedChannels && Number(row.rootBlockNumber) === 0 ? t('remaining.share.user_publications') : String(row.displayName || row.slug || '')}${row.deleted ? t('screens.user_profile_list_view.text_013') : ''}`;
|
||||
const sub = document.createElement('small');
|
||||
sub.textContent = formatChannelAddress({ ownerLogin: row.ownerLogin, channelName: row.slug, channelRootBlockNumber: Number(row.rootBlockNumber) });
|
||||
text.append(title, sub);
|
||||
el.append(text);
|
||||
el.addEventListener('click', () => navigate(`channel/${encodeURIComponent(row.ownerBlockchainName)}/${Number(row.rootBlockNumber || 0)}/${encodeURIComponent(row.rootBlockHashHex || '')}/about`));
|
||||
el.addEventListener('click', () => {
|
||||
// Virtual root rows do not carry a root hash in this API. Resolve by the reserved slug.
|
||||
if (Number(row.rootBlockNumber) === 0) { navigate(`SHiNE/${encodeURIComponent(row.ownerLogin)}/stories`); return; }
|
||||
navigate(`channel/${encodeURIComponent(row.ownerBlockchainName)}/${Number(row.rootBlockNumber || 0)}/${encodeURIComponent(row.rootBlockHashHex || '')}/about`);
|
||||
});
|
||||
return el;
|
||||
}
|
||||
|
||||
function renderRows() {
|
||||
body.replaceChildren();
|
||||
const matches = (row) => (isChannelsScreen
|
||||
? !query || searchText(`${row.displayName} ${row.slug} ${row.ownerLogin}`).includes(query)
|
||||
? !query || searchText(`${row.displayName} ${row.slug} ${row.ownerLogin} ${isOwnedChannels && Number(row.rootBlockNumber) === 0 ? t('remaining.share.user_publications') : ''}`).includes(query)
|
||||
: matchesPeopleQuery(`${userDisplayName(row)} ${row.login}`, query));
|
||||
const visible = rows.filter(matches);
|
||||
if (!rows.length) {
|
||||
@@ -185,6 +203,7 @@ export function render({ navigate, route, chrome }) {
|
||||
: await authService.listUserProfileRelations(login, kind, 200, 0);
|
||||
if (disposed || generation !== loadGeneration) return;
|
||||
rows = Array.isArray(isChannelsScreen ? payload?.channels : payload?.users) ? (isChannelsScreen ? payload.channels : payload.users) : [];
|
||||
if (isOwnedChannels) rows.sort((a, b) => Number(Number(b.rootBlockNumber) === 0) - Number(Number(a.rootBlockNumber) === 0));
|
||||
searchWrap.hidden = rows.length < SEARCH_FROM;
|
||||
renderRows();
|
||||
} catch (error) {
|
||||
|
||||
@@ -60,8 +60,11 @@ export function render({ navigate, route, chrome }) {
|
||||
login: requestedLogin,
|
||||
isSelf,
|
||||
tilesHtml: [
|
||||
profileTileHtml({ icon: 'channels', label: t('remaining.channels.publications'), attrs: 'data-profile-action="publications"' }),
|
||||
...(isSelf ? [] : [
|
||||
...(isSelf ? [
|
||||
profileTileHtml({ icon: 'edit', label: t('screens.profile_view.text_007'), attrs: 'data-profile-action="edit"' }),
|
||||
profileTileHtml({ icon: 'wallet', label: t('screens.profile_view.text_008'), attrs: 'data-profile-action="wallet"' }),
|
||||
profileTileHtml({ icon: 'settings', label: t('screens.profile_view.text_009'), attrs: 'data-profile-action="settings"' }),
|
||||
] : [
|
||||
profileTileHtml({ icon: 'user-plus', label: t('screens.user_profile_view.text_004'), attrs: 'data-profile-action="add"' }),
|
||||
profileTileHtml({ label: t('screens.user_profile_view.text_005'), attrs: 'data-profile-action="links"', iconMarkup: `<img class="pf-tile-mandala" src="${SHINE_CONNECTIONS_LOGO_SRC}" alt="" aria-hidden="true">` }),
|
||||
profileTileHtml({ icon: 'message', label: t('screens.user_profile_view.text_006'), attrs: 'data-profile-action="chat"' }),
|
||||
@@ -119,7 +122,9 @@ export function render({ navigate, route, chrome }) {
|
||||
|
||||
const actionButton = event.target.closest('[data-profile-action]');
|
||||
const action = actionButton?.dataset.profileAction;
|
||||
if (action === 'publications') { navigate(`SHiNE/${encodeURIComponent(card.login)}/stories`); return; }
|
||||
if (action === 'edit') { navigate('profile-edit-view'); return; }
|
||||
if (action === 'wallet') { navigate('wallet-view'); return; }
|
||||
if (action === 'settings') { navigate('settings-view'); return; }
|
||||
if (action === 'add') {
|
||||
navigate(`SHiNE/${encodeURIComponent(card.login)}/manage`);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user