@civic/common-gateway-react
Advanced tools
Comparing version 0.2.0-alpha.1 to 0.2.0-alpha.2
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
import { GatewayStatus } from '../types'; | ||
@@ -3,0 +2,0 @@ export declare const getIcon: (status: GatewayStatus | null | undefined) => JSX.Element; |
@@ -178,2 +178,7 @@ "use strict"; | ||
}, [waitForTransactionConfirm]); | ||
/** Trigger the waiting for owner transaction state */ | ||
const showAwaitingOwnerTransaction = (0, react_1.useCallback)(() => { | ||
logger_1.default.debug('showAwaitingOwnerTransaction'); | ||
dispatch({ type: 'civicPass_awaiting_owner_transaction' }); | ||
}, []); | ||
/** | ||
@@ -196,2 +201,3 @@ * New token request flow ownerSigns: | ||
.then(waitForHandleTransaction) | ||
.then(showAwaitingOwnerTransaction) | ||
.then(waitForOnChainToken) | ||
@@ -253,2 +259,3 @@ .then(() => checkForRefreshWithTimeout(wallet)) | ||
.then(waitForHandleTransaction) | ||
.then(showAwaitingOwnerTransaction) | ||
.then(waitForUnexpiredGatewayToken) | ||
@@ -261,3 +268,3 @@ .catch((error) => { | ||
} | ||
}, [civicPass === null || civicPass === void 0 ? void 0 : civicPass.responsePayload, waitForHandleTransaction, walletToRefresh === null || walletToRefresh === void 0 ? void 0 : walletToRefresh.publicKey, wallet === null || wallet === void 0 ? void 0 : wallet.publicKey, ownerSigns]); | ||
}, [civicPass === null || civicPass === void 0 ? void 0 : civicPass.responsePayload, walletToRefresh === null || walletToRefresh === void 0 ? void 0 : walletToRefresh.publicKey, wallet === null || wallet === void 0 ? void 0 : wallet.publicKey, ownerSigns]); | ||
/** | ||
@@ -264,0 +271,0 @@ * Refresh complete flow: |
@@ -85,3 +85,4 @@ "use strict"; | ||
await chainImplementation.handleUserSignedTransaction(transaction); | ||
dispatch({ type: 'civicPass_awaiting_owner_transaction' }); | ||
dispatch({ type: 'walletPowoComplete' }); | ||
dispatch({ type: 'civicPass_check_token_status' }); | ||
}, [chainImplementation]); | ||
@@ -88,0 +89,0 @@ return { |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
declare type SVGProps = { | ||
@@ -3,0 +2,0 @@ color?: string; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
export default function SVGLoading(): JSX.Element; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
import { GatewayStatus } from '../types'; | ||
@@ -3,0 +2,0 @@ export declare const getIcon: (status: GatewayStatus | null | undefined) => JSX.Element; |
@@ -178,2 +178,7 @@ "use strict"; | ||
}, [waitForTransactionConfirm]); | ||
/** Trigger the waiting for owner transaction state */ | ||
const showAwaitingOwnerTransaction = (0, react_1.useCallback)(() => { | ||
logger_1.default.debug('showAwaitingOwnerTransaction'); | ||
dispatch({ type: 'civicPass_awaiting_owner_transaction' }); | ||
}, []); | ||
/** | ||
@@ -196,2 +201,3 @@ * New token request flow ownerSigns: | ||
.then(waitForHandleTransaction) | ||
.then(showAwaitingOwnerTransaction) | ||
.then(waitForOnChainToken) | ||
@@ -253,2 +259,3 @@ .then(() => checkForRefreshWithTimeout(wallet)) | ||
.then(waitForHandleTransaction) | ||
.then(showAwaitingOwnerTransaction) | ||
.then(waitForUnexpiredGatewayToken) | ||
@@ -261,3 +268,3 @@ .catch((error) => { | ||
} | ||
}, [civicPass === null || civicPass === void 0 ? void 0 : civicPass.responsePayload, waitForHandleTransaction, walletToRefresh === null || walletToRefresh === void 0 ? void 0 : walletToRefresh.publicKey, wallet === null || wallet === void 0 ? void 0 : wallet.publicKey, ownerSigns]); | ||
}, [civicPass === null || civicPass === void 0 ? void 0 : civicPass.responsePayload, walletToRefresh === null || walletToRefresh === void 0 ? void 0 : walletToRefresh.publicKey, wallet === null || wallet === void 0 ? void 0 : wallet.publicKey, ownerSigns]); | ||
/** | ||
@@ -264,0 +271,0 @@ * Refresh complete flow: |
@@ -85,3 +85,4 @@ "use strict"; | ||
await chainImplementation.handleUserSignedTransaction(transaction); | ||
dispatch({ type: 'civicPass_awaiting_owner_transaction' }); | ||
dispatch({ type: 'walletPowoComplete' }); | ||
dispatch({ type: 'civicPass_check_token_status' }); | ||
}, [chainImplementation]); | ||
@@ -88,0 +89,0 @@ return { |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
declare type SVGProps = { | ||
@@ -3,0 +2,0 @@ color?: string; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
export default function SVGLoading(): JSX.Element; |
{ | ||
"name": "@civic/common-gateway-react", | ||
"version": "0.2.0-alpha.1", | ||
"version": "0.2.0-alpha.2", | ||
"main": "./dist/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/esm/index.js", |
358614
7158