Исправить DEVNET topup и автоподстановку пароля

This commit is contained in:
AidarKC
2026-06-03 15:57:49 +04:00
parent 239cc231ea
commit ee3721dfa4
9 changed files with 47 additions and 5 deletions
+11 -1
View File
@@ -19,11 +19,14 @@ function readWalletFromUrl() {
export function render({ navigate }) {
const screen = document.createElement('section');
screen.className = 'stack';
screen.style.width = '100%';
screen.style.justifyItems = 'center';
const targetWallet = readWalletFromUrl();
const senderBox = document.createElement('div');
senderBox.className = 'card stack';
senderBox.style.width = 'min(100%, 320px)';
senderBox.innerHTML = `
<strong>Тестовый DEVNET-кошелёк</strong>
<p class="meta-muted" id="devnet-topup-sender-address">Адрес: ...</p>
@@ -32,6 +35,7 @@ export function render({ navigate }) {
const targetBox = document.createElement('div');
targetBox.className = 'card stack';
targetBox.style.width = 'min(100%, 320px)';
targetBox.innerHTML = `
<strong>Кошелёк получателя</strong>
<p class="meta-muted" style="word-break:break-all;">${targetWallet || 'Не передан параметр wallet'}</p>
@@ -40,6 +44,10 @@ export function render({ navigate }) {
const status = document.createElement('p');
status.className = 'meta-muted';
status.style.width = 'min(100%, 320px)';
status.style.overflowWrap = 'anywhere';
status.style.wordBreak = 'break-word';
status.style.whiteSpace = 'pre-wrap';
status.textContent = 'Готово к пополнению.';
const fillBtn = document.createElement('button');
@@ -55,6 +63,8 @@ export function render({ navigate }) {
const actions = document.createElement('div');
actions.className = 'auth-footer-actions';
actions.style.width = 'min(100%, 320px)';
actions.style.justifySelf = 'center';
actions.append(fillBtn, backBtn);
let senderAddress = '';
@@ -90,7 +100,7 @@ export function render({ navigate }) {
amountSol: TRANSFER_AMOUNT_SOL,
});
await updateSenderBalance();
status.textContent = `Готово. Signature: ${tx.signature}`;
status.textContent = `Готово.\nSignature: ${tx.signature}`;
} catch (error) {
status.textContent = `Ошибка перевода: ${error?.message || 'unknown'}`;
} finally {
+7
View File
@@ -22,12 +22,19 @@ export function render({ navigate }) {
const loginInput = document.createElement('input');
loginInput.className = 'input';
loginInput.type = 'text';
loginInput.autocomplete = 'off';
loginInput.autocapitalize = 'off';
loginInput.spellcheck = false;
loginInput.value = state.loginDraft.login;
loginInput.placeholder = 'Введите логин';
const passwordInput = document.createElement('input');
passwordInput.className = 'input';
passwordInput.type = 'password';
passwordInput.name = 'shine-login-password';
passwordInput.autocomplete = 'new-password';
passwordInput.autocapitalize = 'off';
passwordInput.spellcheck = false;
passwordInput.value = state.loginDraft.password;
passwordInput.placeholder = 'Введите пароль (можно оставить пустым)';
+7
View File
@@ -21,12 +21,19 @@ export function render({ navigate }) {
const loginInput = document.createElement('input');
loginInput.className = 'input';
loginInput.type = 'text';
loginInput.autocomplete = 'off';
loginInput.autocapitalize = 'off';
loginInput.spellcheck = false;
loginInput.value = state.registrationDraft.login;
loginInput.placeholder = 'Введите логин';
const passwordInput = document.createElement('input');
passwordInput.className = 'input';
passwordInput.type = 'password';
passwordInput.name = 'shine-register-password';
passwordInput.autocomplete = 'new-password';
passwordInput.autocapitalize = 'off';
passwordInput.spellcheck = false;
passwordInput.value = state.registrationDraft.password;
passwordInput.placeholder = 'Введите пароль (можно оставить пустым)';