SHA256
Очистить устаревший черновик регистрации
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user