fix(login): keep the app sign-in screen within the eslint ratchets

Split the other ways in out of one component (complexity), finish the async
handlers with void instead of handing promises to React, report a landscape
that fails to load instead of logging it, let the handover wait on settled
settings rather than catching them, and move the one-time code field's props
into a module of their own so MfaCodeStep only exports its component.
This commit is contained in:
Maurice
2026-11-27 21:16:45 +01:00
parent efd34df038
commit 742c0dd72d
6 changed files with 83 additions and 62 deletions
-1
View File
@@ -72,7 +72,6 @@ describe('appBoot', () => {
it('FE-NATIVE-APPBOOT-004: does not wait for settings that never come, nor stop on ones that fail', async () => {
vi.useFakeTimers();
vi.spyOn(console, 'warn').mockImplementation(() => {});
const hanging = vi.fn();
void handOverToApp(new Promise(() => {}), hanging);
await vi.advanceTimersByTimeAsync(1600);
+2 -4
View File
@@ -42,10 +42,8 @@ const wait = (ms: number): Promise<void> => new Promise((resolve) => window.setT
* the app, which rises in once its first screen is there (endAppBoot).
*/
export function handOverToApp(settings: Promise<unknown>, go: () => void): Promise<void> {
const ready = Promise.race([settings, wait(SETTINGS_WAIT_MS)]).then(
() => undefined,
(err: unknown) => console.warn('Settings not ready for the handover:', err)
);
// allSettled: settings that fail to load must not hold the app back either.
const ready = Promise.race([Promise.allSettled([settings]), wait(SETTINGS_WAIT_MS)]);
return Promise.all([ready, wait(LEAVE_MS)]).then(() => {
document.documentElement.setAttribute(HANDOVER, '');
go();