fix(пополнение): нажатая сумма видна в поле — пустое поле читалось как «не сработало»

Хозяин нажал «500 ₽» в окне пополнения 21.11.2026: сумма запоминалась для отправки, но
поле оставалось пустым. Теперь нажатие пишет сумму в поле (программная запись не будит
oninput, подсветка выбора цела). Проверка — настоящая страница чата в браузере.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
anor
2026-11-21 00:41:40 +10:00
co-authored by Claude Code
parent 4b6c0e15e2
commit 2f9cd63127
5 changed files with 85 additions and 10 deletions
+12
View File
@@ -116,6 +116,18 @@ window.fetch = async (url, opts={}) => {
window._recalc = (window._recalc || 0) + 1;
return _json({title: 'Смета (пересчёт)', positions, totals: {grand_total: gt}, ok: true, missing: []});
}
// Пополнение — только когда тест попросил (stub_topup=1), иначе прежнее поведение.
if (url.includes('/api/limits')) {
if (localStorage.getItem('stub_topup') === '1') {
return _json({account: {balance_rub: 0, low: false, exhausted: false},
topup: {enabled: true, presets: [500, 1000, 3000, 5000], min: 300, max: 20000}});
}
return _json({unlimited: true});
}
if (url.includes('/api/topups')) {
window._topupBody = opts.body || '';
return _json({topup_id: 1, pay_url: '#', result_token: '1.stub'});
}
if (url.includes('/api/feedback')) { window._fb++; return _json({}); }
if (url.includes('/api/history')) return _json([]);
// UX-победы 2026-07-21: версия/чейнджлог («что нового») + демо-смета