SHA256
Локализовать интерфейс SHiNE на русский и английский
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { t } from '../i18n/index.js';
|
||||
import { createTopBar } from '../components/topbar.js';
|
||||
import { authService, state } from '../state.js';
|
||||
import { getRegistrationStatus } from '../services/registration-v2-api.js';
|
||||
@@ -16,7 +17,7 @@ import {
|
||||
isUpgradeComplete, solFromLamports,
|
||||
} from '../services/registration-upgrade-helpers.js';
|
||||
|
||||
export const pageMeta = { id: 'registration-upgrade-view', title: 'Регистрация в Solana' };
|
||||
export const pageMeta = { id: 'registration-upgrade-view', get title() { return t('screens.registration_upgrade_view.text_001'); } };
|
||||
const SYNC_INTERVAL_MS = 3000;
|
||||
const SYNC_NOTICE_AFTER_MS = 90000;
|
||||
|
||||
@@ -51,54 +52,54 @@ export function render({ navigate, chrome }) {
|
||||
const isDevnet = getSolanaCluster() === 'devnet';
|
||||
const screen = element('section', 'stack');
|
||||
chrome?.setTopbar(createTopBar({
|
||||
title: 'Закрепить аккаунт в Solana',
|
||||
title: t('screens.registration_upgrade_view.text_002'),
|
||||
back: { label: '←', onClick: () => navigate('settings-view') },
|
||||
}));
|
||||
|
||||
const intro = element('div', 'card stack');
|
||||
intro.append(
|
||||
element('h3', '', 'Сделайте аккаунт независимым от сервера'),
|
||||
element('p', 'meta-muted', `Ваш аккаунт ${login} зарегистрирован с помощью бесплатного сертификата Arweave. Запись неизменяема и подписана сервером-регистратором.`),
|
||||
element('p', 'meta-muted', 'Сейчас управление ключами и переход на другой сервер ограничены: ваша регистрация зависит от сервера и сохранности его ключей.'),
|
||||
element('p', 'meta-muted', 'После закрепления в Solana у вас появится собственная PDA: вы сможете самостоятельно менять пароль и ключи, а также пользоваться совместимыми серверами.'),
|
||||
element('p', 'meta-muted', 'Логин, namespace, три публичных ключа, публикации и история Arweave останутся прежними. Для доступности истории на другом сервере требуется её синхронизация.'),
|
||||
element('p', 'meta-muted', 'Вы платите цену своего namespace один раз. Депозит PDA уже включён, отдельно оплачивается только комиссия сети Solana.'),
|
||||
element('h3', '', t('screens.registration_upgrade_view.text_011')),
|
||||
element('p', 'meta-muted', t('screens.registration_upgrade_view.text_057', { value1: login })),
|
||||
element('p', 'meta-muted', t('screens.registration_upgrade_view.text_012')),
|
||||
element('p', 'meta-muted', t('screens.registration_upgrade_view.text_013')),
|
||||
element('p', 'meta-muted', t('screens.registration_upgrade_view.text_014')),
|
||||
element('p', 'meta-muted', t('screens.registration_upgrade_view.text_015')),
|
||||
);
|
||||
const introStatus = element('p', 'status-line', 'Проверяем бесплатный сертификат, PDA и актуальную стоимость…');
|
||||
const introStatus = element('p', 'status-line', t('screens.registration_upgrade_view.text_016'));
|
||||
introStatus.setAttribute('aria-live', 'polite');
|
||||
const continueButton = makeButton('Продолжить и пополнить кошелёк');
|
||||
const continueButton = makeButton(t('screens.registration_upgrade_view.text_017'));
|
||||
continueButton.disabled = true;
|
||||
intro.append(continueButton, introStatus);
|
||||
|
||||
const payment = element('div', 'card stack registration-payment-card');
|
||||
payment.append(element('h3', '', 'Оплата регистрации Solana'));
|
||||
const walletHeading = element('h4', 'registration-payment-wallet-heading', 'Ваш Solana-кошелёк в Сиянии');
|
||||
const walletHint = element('p', 'meta-muted registration-payment-wallet-hint', 'Пополните этот кошелёк в сети Solana для регистрации. Адрес уже связан с ключами вашего аккаунта SHiNE — новый кошелёк не создаётся.');
|
||||
const walletLabel = element('label', 'field-label', 'Адрес кошелька');
|
||||
payment.append(element('h3', '', t('screens.registration_upgrade_view.text_018')));
|
||||
const walletHeading = element('h4', 'registration-payment-wallet-heading', t('screens.registration_upgrade_view.text_019'));
|
||||
const walletHint = element('p', 'meta-muted registration-payment-wallet-hint', t('screens.registration_upgrade_view.text_020'));
|
||||
const walletLabel = element('label', 'field-label', t('screens.registration_upgrade_view.text_021'));
|
||||
const wallet = document.createElement('input');
|
||||
wallet.className = 'input'; wallet.type = 'text'; wallet.readOnly = true;
|
||||
wallet.style.width = '100%'; wallet.setAttribute('aria-label', 'Адрес Solana-кошелька');
|
||||
const copyButton = makeButton('Скопировать адрес', 'secondary-btn registration-payment-action registration-payment-copy-btn');
|
||||
wallet.style.width = '100%'; wallet.setAttribute('aria-label', t('screens.registration_upgrade_view.text_069'));
|
||||
const copyButton = makeButton(t('screens.registration_upgrade_view.text_022'), 'secondary-btn registration-payment-action registration-payment-copy-btn');
|
||||
const walletSection = element('div', 'registration-payment-wallet');
|
||||
walletSection.append(walletHeading, walletHint, walletLabel, wallet, copyButton);
|
||||
|
||||
const balanceLine = element('strong', 'registration-payment-balance-value', '— SOL');
|
||||
balanceLine.setAttribute('aria-live', 'polite');
|
||||
const balanceLabel = element('span', 'registration-payment-balance-label', 'Баланс');
|
||||
const balanceLabel = element('span', 'registration-payment-balance-label', t('screens.registration_upgrade_view.text_023'));
|
||||
const balanceInfo = element('div', 'registration-payment-balance-info');
|
||||
balanceInfo.append(balanceLabel, balanceLine);
|
||||
const refreshButton = makeButton('↻ Обновить', 'secondary-btn registration-payment-action registration-payment-refresh-btn');
|
||||
refreshButton.title = 'Обновить баланс Solana';
|
||||
const refreshButton = makeButton(t('screens.registration_upgrade_view.text_024'), 'secondary-btn registration-payment-action registration-payment-refresh-btn');
|
||||
refreshButton.title = t('screens.registration_upgrade_view.text_003');
|
||||
const balanceRow = element('div', 'registration-payment-balance');
|
||||
balanceRow.append(balanceInfo, refreshButton);
|
||||
const topupButton = makeButton(`Тестовое пополнение (+${UPGRADE_TEST_TOPUP_SOL} SOL)`, 'secondary-btn registration-payment-action registration-payment-topup-btn');
|
||||
const testHint = element('p', 'meta-muted registration-payment-test-hint', 'Только для сети devnet. Тестовые SOL не имеют реальной стоимости.');
|
||||
const amount = element('div', 'registration-payment-fees', 'Получаем стоимость регистрации…');
|
||||
const passwordLabel = element('label', 'field-label', 'Пароль действующего аккаунта');
|
||||
const topupButton = makeButton(t('screens.registration_upgrade_view.text_058', { value1: UPGRADE_TEST_TOPUP_SOL }), 'secondary-btn registration-payment-action registration-payment-topup-btn');
|
||||
const testHint = element('p', 'meta-muted registration-payment-test-hint', t('screens.registration_upgrade_view.text_025'));
|
||||
const amount = element('div', 'registration-payment-fees', t('screens.registration_upgrade_view.text_026'));
|
||||
const passwordLabel = element('label', 'field-label', t('screens.registration_upgrade_view.text_027'));
|
||||
const password = document.createElement('input');
|
||||
password.className = 'input'; password.type = 'password'; password.autocomplete = 'current-password';
|
||||
password.placeholder = 'Введите пароль для подтверждения исходных ключей';
|
||||
const payButton = makeButton('Оплатить и закрепить аккаунт');
|
||||
password.placeholder = t('screens.registration_upgrade_view.text_004');
|
||||
const payButton = makeButton(t('screens.registration_upgrade_view.text_028'));
|
||||
const payStatus = element('p', 'status-line');
|
||||
payStatus.setAttribute('aria-live', 'polite');
|
||||
payment.append(walletSection, balanceRow);
|
||||
@@ -106,21 +107,21 @@ export function render({ navigate, chrome }) {
|
||||
payment.append(amount, passwordLabel, password, payButton, payStatus);
|
||||
|
||||
const syncing = element('div', 'card stack');
|
||||
syncing.append(element('h3', '', 'Проверяем регистрацию'));
|
||||
const syncInfo = element('p', 'meta-muted', 'Проверяем PDA в Solana и обновление статуса на сервере…');
|
||||
syncing.append(element('h3', '', t('screens.registration_upgrade_view.text_029')));
|
||||
const syncInfo = element('p', 'meta-muted', t('screens.registration_upgrade_view.text_030'));
|
||||
const txLine = element('p', 'meta-muted');
|
||||
const syncStatus = element('p', 'status-line');
|
||||
syncStatus.setAttribute('aria-live', 'polite');
|
||||
const checkButton = makeButton('Проверить ещё раз', 'ghost-btn');
|
||||
const checkButton = makeButton(t('screens.registration_upgrade_view.text_031'), 'ghost-btn');
|
||||
syncing.append(syncInfo, txLine, syncStatus, checkButton);
|
||||
|
||||
const done = element('div', 'card stack');
|
||||
done.append(
|
||||
element('h3', '', 'Поздравляем! Ваш аккаунт теперь полноценный!'),
|
||||
element('p', 'meta-muted', `Ваш логин ${login} и namespace не изменились. Регистрация подтверждена PDA Solana. Прежние ключи и история сохранены.`),
|
||||
element('p', 'meta-muted', 'Регистрация подтверждена Solana. Теперь вы самостоятельно управляете ключами и можете переходить между совместимыми серверами доступа.'),
|
||||
element('h3', '', t('screens.registration_upgrade_view.text_032')),
|
||||
element('p', 'meta-muted', t('screens.registration_upgrade_view.text_059', { value1: login })),
|
||||
element('p', 'meta-muted', t('screens.registration_upgrade_view.text_033')),
|
||||
);
|
||||
const settingsButton = makeButton('Вернуться в настройки');
|
||||
const settingsButton = makeButton(t('screens.registration_upgrade_view.text_034'));
|
||||
settingsButton.addEventListener('click', () => navigate('settings-view'));
|
||||
done.append(settingsButton);
|
||||
screen.append(intro, payment, syncing, done);
|
||||
@@ -158,19 +159,19 @@ export function render({ navigate, chrome }) {
|
||||
async function balanceUpdate(showError = true) {
|
||||
if (!walletAddress) return null;
|
||||
refreshButton.disabled = true;
|
||||
refreshButton.textContent = '↻ Обновляем…';
|
||||
refreshButton.textContent = t('screens.registration_upgrade_view.text_005');
|
||||
try {
|
||||
const balance = await getBalanceSol({ endpoint: solanaEndpoint, address: walletAddress });
|
||||
if (disposed) return null;
|
||||
balanceLine.textContent = `${formatSol(balance.sol, 6)} SOL`;
|
||||
return BigInt(balance.lamports);
|
||||
} catch (error) {
|
||||
if (showError) message(payStatus, `Не удалось прочитать баланс: ${error.message}`, true);
|
||||
if (showError) message(payStatus, t('screens.registration_upgrade_view.text_060', { value1: error.message }), true);
|
||||
return null;
|
||||
} finally {
|
||||
if (!disposed) {
|
||||
refreshButton.disabled = false;
|
||||
refreshButton.textContent = '↻ Обновить';
|
||||
refreshButton.textContent = t('screens.registration_upgrade_view.text_006');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,13 +179,13 @@ export function render({ navigate, chrome }) {
|
||||
const presence = await checkLoginExistsOnSolana({ login, solanaEndpoint });
|
||||
if (!presence.exists) return false;
|
||||
const pda = await readShineUserPda({ login, solanaEndpoint });
|
||||
if (pda.login !== login) throw new Error('Найденная PDA принадлежит другому логину');
|
||||
if (pda.login !== login) throw new Error(t('screens.registration_upgrade_view.text_047'));
|
||||
// Если сервер ещё считает аккаунт бесплатным, проверяем совпадение с исходным сертификатом.
|
||||
if (expectedIdentity?.registrationStatus === 'FREE_CERT') {
|
||||
if (bytesToBase58(pda.rootKey) !== expectedIdentity.rootPublicKey ||
|
||||
bytesToBase58(pda.clientKey) !== expectedIdentity.clientPublicKey ||
|
||||
bytesToBase58(pda.forks[0].blockchainKey) !== expectedIdentity.blockchainPublicKey) {
|
||||
throw new Error('Ключи существующей PDA не соответствуют бесплатному сертификату');
|
||||
throw new Error(t('screens.registration_upgrade_view.text_048'));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -197,7 +198,7 @@ export function render({ navigate, chrome }) {
|
||||
const onChainExists = await hasVerifiedPda();
|
||||
if (disposed) return;
|
||||
if (!onChainExists) {
|
||||
message(syncStatus, 'PDA пока не обнаружена в Solana. Продолжаем проверку…');
|
||||
message(syncStatus, t('screens.registration_upgrade_view.text_035'));
|
||||
return;
|
||||
}
|
||||
const current = await getRegistrationStatus(login);
|
||||
@@ -207,17 +208,17 @@ export function render({ navigate, chrome }) {
|
||||
return;
|
||||
}
|
||||
if (current.registrationStatus !== 'FREE_CERT') {
|
||||
message(syncStatus, `Сервер вернул неожиданный статус: ${current.registrationStatus}.`, true);
|
||||
message(syncStatus, t('screens.registration_upgrade_view.text_061', { value1: current.registrationStatus }), true);
|
||||
return;
|
||||
}
|
||||
message(syncStatus, 'PDA создана в Solana. Ожидаем, пока сервер синхронизирует аккаунт…');
|
||||
message(syncStatus, t('screens.registration_upgrade_view.text_036'));
|
||||
} catch (error) {
|
||||
message(syncStatus, `Проверка пока не удалась: ${error.message}`, true);
|
||||
message(syncStatus, t('screens.registration_upgrade_view.text_062', { value1: error.message }), true);
|
||||
} finally {
|
||||
checking = false;
|
||||
if (!disposed) checkButton.disabled = false;
|
||||
if (!disposed && Date.now() - startedPollingAt > SYNC_NOTICE_AFTER_MS) {
|
||||
syncInfo.textContent = 'Синхронизация задержалась. Можете вернуться в настройки и открыть этот экран позже: повторная оплата не нужна.';
|
||||
syncInfo.textContent = t('screens.registration_upgrade_view.text_007');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,16 +235,16 @@ export function render({ navigate, chrome }) {
|
||||
if (anchor) {
|
||||
txLine.append('Tx ID: ', anchor);
|
||||
} else {
|
||||
txLine.textContent = 'Проверяем запись Solana по вашему логину.';
|
||||
txLine.textContent = t('screens.registration_upgrade_view.text_008');
|
||||
}
|
||||
}
|
||||
async function initialize() {
|
||||
if (!login.includes('@')) throw new Error('Войдите в существующий аккаунт login@namespace');
|
||||
if (!login.includes('@')) throw new Error(t('screens.registration_upgrade_view.text_049'));
|
||||
const current = await getRegistrationStatus(login);
|
||||
if (disposed) return;
|
||||
// Уже платный аккаунт не должен повторно попадать в мастер покупки.
|
||||
if (isUpgradeComplete(current.registrationStatus)) { navigate('settings-view'); return; }
|
||||
if (current.registrationStatus !== 'FREE_CERT') throw new Error('Переход доступен только для бесплатного аккаунта');
|
||||
if (current.registrationStatus !== 'FREE_CERT') throw new Error(t('screens.registration_upgrade_view.text_050'));
|
||||
// Проверяем наличие PDA до любых новых платежей. Это также позволяет возобновить проверку после перезагрузки.
|
||||
const onChainExists = await hasVerifiedPda(current);
|
||||
if (disposed) return;
|
||||
@@ -253,8 +254,8 @@ export function render({ navigate, chrome }) {
|
||||
return;
|
||||
}
|
||||
const loadedNamespace = await getNamespace({ namespace: login.split('@')[1], solanaEndpoint });
|
||||
if (loadedNamespace.type !== 2) throw new Error('Для бесплатного сертификата требуется namespace типа 2');
|
||||
if (!current.innerSignature64B64 || !current.blockchainPublicKey) throw new Error('Исходный сертификат отсутствует или неполон');
|
||||
if (loadedNamespace.type !== 2) throw new Error(t('screens.registration_upgrade_view.text_051'));
|
||||
if (!current.innerSignature64B64 || !current.blockchainPublicKey) throw new Error(t('screens.registration_upgrade_view.text_052'));
|
||||
const web3 = await loadSolanaWeb3();
|
||||
const connection = new web3.Connection(solanaEndpoint, 'confirmed');
|
||||
const rentLamports = await connection.getMinimumBalanceForRentExemption(USER_PDA_SPACE, 'confirmed');
|
||||
@@ -267,19 +268,19 @@ export function render({ navigate, chrome }) {
|
||||
const pubkey = new web3.PublicKey(walletAddress);
|
||||
walletAddress = pubkey.toBase58();
|
||||
wallet.value = walletAddress;
|
||||
amount.replaceChildren(element('h4', 'registration-payment-fees-title', 'Стоимость регистрации'));
|
||||
amount.replaceChildren(element('h4', 'registration-payment-fees-title', t('screens.registration_upgrade_view.text_037')));
|
||||
for (const [label, lamports, emphasized] of [
|
||||
['Регистрация в namespace (депозит PDA включён)', funding.namespaceFee, true],
|
||||
['Запас на комиссию сети Solana', funding.networkReserve, false],
|
||||
['Для оплаты достаточно иметь на кошельке', funding.requiredLamports, false],
|
||||
[t('screens.registration_upgrade_view.text_044'), funding.namespaceFee, true],
|
||||
[t('screens.registration_upgrade_view.text_045'), funding.networkReserve, false],
|
||||
[t('screens.registration_upgrade_view.text_046'), funding.requiredLamports, false],
|
||||
]) {
|
||||
const row = element('div', `registration-payment-fee-row${emphasized ? ' registration-payment-fee-row--emphasis' : ''}`);
|
||||
row.append(element('span', '', label), element('strong', '', `${solFromLamports(lamports)} SOL`));
|
||||
amount.append(row);
|
||||
}
|
||||
amount.append(element('p', 'meta-muted', 'Сеть спишет фактическую комиссию транзакции; неизрасходованный запас останется на кошельке.'));
|
||||
amount.append(element('p', 'meta-muted', t('screens.registration_upgrade_view.text_038')));
|
||||
continueButton.disabled = false;
|
||||
message(introStatus, 'Данные аккаунта и стоимость проверены.');
|
||||
message(introStatus, t('screens.registration_upgrade_view.text_039'));
|
||||
}
|
||||
|
||||
continueButton.addEventListener('click', () => {
|
||||
@@ -289,11 +290,11 @@ export function render({ navigate, chrome }) {
|
||||
copyButton.addEventListener('click', async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(walletAddress);
|
||||
copyButton.textContent = '✓ Адрес скопирован';
|
||||
window.setTimeout(() => { if (!disposed) copyButton.textContent = 'Скопировать адрес'; }, 1600);
|
||||
message(payStatus, 'Адрес кошелька скопирован.');
|
||||
copyButton.textContent = t('screens.registration_upgrade_view.text_009');
|
||||
window.setTimeout(() => { if (!disposed) copyButton.textContent = t('screens.registration_upgrade_view.text_010'); }, 1600);
|
||||
message(payStatus, t('screens.registration_upgrade_view.text_040'));
|
||||
} catch {
|
||||
message(payStatus, 'Не удалось скопировать адрес. Можно скопировать его вручную.', true);
|
||||
message(payStatus, t('screens.registration_upgrade_view.text_041'), true);
|
||||
}
|
||||
});
|
||||
refreshButton.addEventListener('click', () => void balanceUpdate());
|
||||
@@ -301,13 +302,13 @@ export function render({ navigate, chrome }) {
|
||||
if (!isDevnet || disposed || !walletAddress) return;
|
||||
topupButton.disabled = true;
|
||||
try {
|
||||
message(payStatus, `Переводим ${UPGRADE_TEST_TOPUP_SOL} тестовых SOL в devnet…`);
|
||||
message(payStatus, t('screens.registration_upgrade_view.text_063', { value1: UPGRADE_TEST_TOPUP_SOL }));
|
||||
const result = await fundDevnetRegistrationWallet(walletAddress);
|
||||
if (disposed) return;
|
||||
balanceLine.textContent = `${formatSol(result.sol, 6)} SOL`;
|
||||
message(payStatus, `Тестовое пополнение +${UPGRADE_TEST_TOPUP_SOL} SOL выполнено.`);
|
||||
message(payStatus, t('screens.registration_upgrade_view.text_064', { value1: UPGRADE_TEST_TOPUP_SOL }));
|
||||
} catch (error) {
|
||||
message(payStatus, `Тестовое пополнение недоступно (${error.message}). Используйте внешний devnet faucet и обновите баланс.`, true);
|
||||
message(payStatus, t('screens.registration_upgrade_view.text_065', { value1: error.message }), true);
|
||||
} finally {
|
||||
if (!disposed) topupButton.disabled = false;
|
||||
}
|
||||
@@ -317,8 +318,8 @@ export function render({ navigate, chrome }) {
|
||||
sending = true;
|
||||
payButton.disabled = true;
|
||||
try {
|
||||
if (!identity || !namespace || !funding) throw new Error('Данные регистрации ещё не готовы');
|
||||
if (!password.value) throw new Error('Введите пароль существующего аккаунта');
|
||||
if (!identity || !namespace || !funding) throw new Error(t('screens.registration_upgrade_view.text_053'));
|
||||
if (!password.value) throw new Error(t('screens.registration_upgrade_view.text_054'));
|
||||
// Повторно сверяем Solana: уже зарегистрированную PDA не оплачиваем второй раз.
|
||||
const pdaExists = await hasVerifiedPda();
|
||||
if (pdaExists) { password.value = ''; markTransaction(''); watchSync(); return; }
|
||||
@@ -326,9 +327,9 @@ export function render({ navigate, chrome }) {
|
||||
if (balanceLamports === null) return;
|
||||
if (balanceLamports < funding.requiredLamports) {
|
||||
const shortage = funding.requiredLamports - balanceLamports;
|
||||
throw new Error(`Недостаточно SOL. Пополните кошелёк ещё минимум на ${solFromLamports(shortage)} SOL.`);
|
||||
throw new Error(t('screens.registration_upgrade_view.text_066', { value1: solFromLamports(shortage) }));
|
||||
}
|
||||
message(payStatus, 'Проверяем исходный пароль и восстанавливаем ваши ключи локально…');
|
||||
message(payStatus, t('screens.registration_upgrade_view.text_042'));
|
||||
const keys = await authService.derivePasswordKeyBundle(login, password.value);
|
||||
if (disposed) return;
|
||||
for (const [pair, expected] of [
|
||||
@@ -337,12 +338,12 @@ export function render({ navigate, chrome }) {
|
||||
[keys.clientPair, identity.clientPublicKey],
|
||||
]) {
|
||||
if (bytesToBase58(base64ToBytes(pair.publicKeyB64)) !== expected) {
|
||||
throw new Error('Пароль не совпадает с исходными ключами сертификата');
|
||||
throw new Error(t('screens.registration_upgrade_view.text_055'));
|
||||
}
|
||||
}
|
||||
const signature = base64ToBytes(identity.innerSignature64B64);
|
||||
if (signature.length !== 64) throw new Error('Сертификат не содержит подписи регистратора');
|
||||
message(payStatus, 'Подписываем транзакцию и создаём вашу PDA в Solana…');
|
||||
if (signature.length !== 64) throw new Error(t('screens.registration_upgrade_view.text_056'));
|
||||
message(payStatus, t('screens.registration_upgrade_view.text_043'));
|
||||
const result = await upgradeFreeUserOnSolana({
|
||||
login, keyBundle: keys, solanaEndpoint, innerSignature64: signature,
|
||||
accessServers: identity.defaultServerLogin ? [identity.defaultServerLogin] : [],
|
||||
@@ -357,7 +358,7 @@ export function render({ navigate, chrome }) {
|
||||
const pdaExists = await hasVerifiedPda();
|
||||
if (pdaExists) { password.value = ''; markTransaction(''); watchSync(); return; }
|
||||
} catch { /* Отсутствие связи с RPC не доказывает отсутствие PDA. */ }
|
||||
message(payStatus, `Регистрация не завершена: ${formatSolanaErrorDetails(error)}. Проверьте статус перед повторной попыткой.`, true);
|
||||
message(payStatus, t('screens.registration_upgrade_view.text_067', { value1: formatSolanaErrorDetails(error) }), true);
|
||||
} finally {
|
||||
sending = false;
|
||||
if (!disposed) payButton.disabled = false;
|
||||
@@ -365,7 +366,7 @@ export function render({ navigate, chrome }) {
|
||||
});
|
||||
checkButton.addEventListener('click', () => void checkSync());
|
||||
show('intro');
|
||||
void initialize().catch((error) => message(introStatus, `Не удалось подготовить переход: ${error.message}`, true));
|
||||
void initialize().catch((error) => message(introStatus, t('screens.registration_upgrade_view.text_068', { value1: error.message }), true));
|
||||
screen.cleanup = () => { disposed = true; stopPolling(); password.value = ''; };
|
||||
return screen;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user