Очистить устаревший черновик регистрации

This commit is contained in:
AidarKC
2026-11-16 10:59:27 +03:00
parent 1b86bca19a
commit 102feccb2e
7 changed files with 71 additions and 72 deletions
+4 -10
View File
@@ -1,10 +1,13 @@
import { t } from '../i18n/index.js';
import { createTopBar } from '../components/topbar.js';
import { state } from '../state.js';
import { resetRegistrationFlow, state } from '../state.js';
export const pageMeta = { id: 'registration-choice-view', get title() { return t('screens.registration_choice_view.text_001'); }, showAppChrome: false };
export function render({ navigate }) {
// Экран выбора начинает новую регистрацию. Старый незавершённый черновик
// нельзя переносить в новый сценарий, особенно после неудачной попытки.
resetRegistrationFlow();
const screen = document.createElement('section');
screen.className = 'stack registration-screen signup-choice';
const title = document.createElement('h1');
@@ -45,15 +48,6 @@ export function render({ navigate }) {
action.textContent = button;
action.addEventListener('click', () => {
const draft = state.registrationDraft;
if (draft.flowType !== type) {
// При смене namespace старые ключи/коды больше не соответствуют выбранному аккаунту.
draft.login = '';
draft.password = '';
draft.preGeneratedKeyBundle = null;
draft.challengeId = '';
draft.challengeExpiresAtMs = 0;
draft.email = '';
}
draft.flowType = type;
draft.uiStep = 1;
navigate('register-view');