From 9236aa8bfb5ebcb63f7e519eefecd132ced7beee Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Aug 2026 21:33:29 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20login:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20visible=20feedback=20+=20version=20bump=20v=3D9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 20 ++++++++++---------- public/js/app.js | 15 +++++++++++---- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/public/index.html b/public/index.html index 30befe3..0e2c0d7 100644 --- a/public/index.html +++ b/public/index.html @@ -34,15 +34,15 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/public/js/app.js b/public/js/app.js index db51f9c..95c2aa0 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -245,14 +245,21 @@ const App = { async emailLogin() { const email = document.getElementById('el-email').value.trim(); const pass = document.getElementById('el-pass').value; + const btn = document.getElementById('el-login'); + const hint = document.getElementById('el-hint'); + if (btn) { btn.disabled = true; btn.textContent = '⏳ Входим…'; } try { - await API.Auth.loginEmail(email, pass); + const r = await API.Auth.loginEmail(email, pass); + if (hint) hint.textContent = '✓ Вошли, грузим профиль…'; await API.Auth.me(); - // для email-логина согласия можно проверить, но юзер их уже дал - await this.maybeOnboard(); + if (hint) hint.textContent = '✓ Готово'; + this.maybeOnboard(); // fire-and-forget this.showView('map'); } catch (e) { - TG_APP.showAlert('Ошибка: ' + e.message); + console.error('login failed:', e); + if (hint) { hint.textContent = '⚠️ ' + e.message; hint.style.color = 'var(--danger)'; } + TG_APP.showAlert('Ошибка входа: ' + e.message); + if (btn) { btn.disabled = false; btn.textContent = 'Войти'; } } },