From 82431870754baa8520723fc3b3234dc815f80aae Mon Sep 17 00:00:00 2001 From: Harsh Vardhan Date: Wed, 18 Oct 2023 18:58:09 +0530 Subject: [PATCH] feat(INJI-472): show loader on issuer select Co-authored-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> Signed-off-by: Harsh Vardhan --- .talismanrc | 2 +- machines/issuersMachine.ts | 8 ++++---- machines/issuersMachine.typegen.ts | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.talismanrc b/.talismanrc index ad79c9639d..61567db5ee 100644 --- a/.talismanrc +++ b/.talismanrc @@ -43,7 +43,7 @@ fileignoreconfig: - filename: machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.ts checksum: 3ac59db154914fec7770e14b0451f21f98a0fe8bb0b0243e800ae3aac8a2941d - filename: machines/issuersMachine.ts - checksum: fa1db95fbe9f635979f481d57793cb99114f34a8a5e17fbc4e0c41ef6197d783 + checksum: f86249731a374b108891be4661bfaffb42b6e7115ee82aa69e99e0fce6319534 - filename: machines/issuersMachine.typegen.ts checksum: 31bb8e3b650b076815dd1186487918bd48f46195c8ec82c916d7f7a16c0b5df2 version: "" diff --git a/machines/issuersMachine.ts b/machines/issuersMachine.ts index 7ccaf426ac..a7d96810b3 100644 --- a/machines/issuersMachine.ts +++ b/machines/issuersMachine.ts @@ -116,7 +116,7 @@ export const IssuersMachine = model.createMachine( }, { description: 'not fetched issuers config yet', - actions: ['setLoadingReasonAsDisplayIssuers', 'resetError'], + actions: ['setLoadingReasonAsSettingUp', 'resetError'], target: 'downloadIssuerConfig', }, ], @@ -133,7 +133,7 @@ export const IssuersMachine = model.createMachine( actions: sendParent('DOWNLOAD_ID'), }, SELECTED_ISSUER: { - actions: 'setSelectedIssuerId', + actions: ['setSelectedIssuerId', 'setLoadingReasonAsSettingUp'], target: 'downloadIssuerConfig', }, }, @@ -211,7 +211,7 @@ export const IssuersMachine = model.createMachine( }, checkKeyPair: { description: 'checks whether key pair is generated', - entry: [send('CHECK_KEY_PAIR'), 'setLoadingReasonAsSettingUp'], + entry: ['setLoadingReasonAsSettingUp', send('CHECK_KEY_PAIR')], on: { CHECK_KEY_PAIR: [ { @@ -520,7 +520,7 @@ export const IssuersMachine = model.createMachine( ); return await authorize(context.selectedIssuer); }, - generateKeyPair: async context => { + generateKeyPair: async () => { if (!isCustomKeystore) { return await generateKeys(); } diff --git a/machines/issuersMachine.typegen.ts b/machines/issuersMachine.typegen.ts index 9e19a6947b..f7f7776388 100644 --- a/machines/issuersMachine.typegen.ts +++ b/machines/issuersMachine.typegen.ts @@ -105,7 +105,10 @@ export interface Typegen0 { setIssuers: 'done.invoke.issuersMachine.displayIssuers:invocation[0]'; setLoadingReasonAsDisplayIssuers: 'TRY_AGAIN'; setLoadingReasonAsDownloadingCredentials: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]'; - setLoadingReasonAsSettingUp: 'done.invoke.issuersMachine.performAuthorization:invocation[0]'; + setLoadingReasonAsSettingUp: + | 'SELECTED_ISSUER' + | 'TRY_AGAIN' + | 'done.invoke.issuersMachine.performAuthorization:invocation[0]'; setNoInternet: 'done.invoke.checkInternet'; setOIDCConfigError: 'error.platform.issuersMachine.performAuthorization:invocation[0]'; setPrivateKey: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';