on master help sign in
fix: cleanup imports, add timing constnat
commit5088ea656958b0bc839183813973906673fca3a8 authorMatt Condon (shrugs) <mattgcondon@gmail.com> dateWed 21 Aug 2019, 17:14 (7 years ago) parent54fae1c
2 files changed+13−6
src/lib/constants.js+3 src/lib/useEthereumTransaction.js+10−6
src/lib/constants.js+3
@@ -69,6 +69,8 @@ const PROFILE_STATES = {
6969 INPUT_ERROR: Symbol('INPUT_ERROR'),
7070};
7171
72+const PROGRESS_ANIMATION_DELAY_MS = 500; // .animated-width
73+
7274export {
7375 CHECK_BLOCK_EVERY_MS,
7476 DEFAULT_GAS_PRICE_GWEI,
@@ -87,4 +89,5 @@ export {
8789 GALAXY_ENTROPY_BITS,
8890 SEED_ENTROPY_BITS,
8991 ZOD,
92+ PROGRESS_ANIMATION_DELAY_MS,
9093};
src/lib/useEthereumTransaction.js+10−6
@@ -6,7 +6,11 @@ import { useNetwork } from 'store/network';
66import { useWallet } from 'store/wallet';
77import { usePointCursor } from 'store/pointCursor';
88
9−import { GAS_LIMITS, DEFAULT_GAS_PRICE_GWEI } from './constants';
9+import {
10+ GAS_LIMITS,
11+ DEFAULT_GAS_PRICE_GWEI,
12+ PROGRESS_ANIMATION_DELAY_MS,
13+} from './constants';
1014import {
1115 signTransaction,
1216 sendSignedTransaction,
@@ -15,9 +19,9 @@ import {
1519} from './txn';
1620import * as need from 'lib/need';
1721import { ensureFundsFor } from 'lib/tank';
18−import useDeepEqualReference from './useDeepEqualReference';
19−import useGasPrice from './useGasPrice';
20−import timeout from './timeout';
22+import useDeepEqualReference from 'lib/useDeepEqualReference';
23+import useGasPrice from 'lib/useGasPrice';
24+import timeout from 'lib/timeout';
2125
2226const STATE = {
2327 NONE: 'NONE',
@@ -159,7 +163,7 @@ export default function useEthereumTransaction(
159163 setState(STATE.BROADCASTED);
160164 setTxHash(txHash);
161165
162− await timeout(500); // wait for .animated-width to complete
166+ await timeout(PROGRESS_ANIMATION_DELAY_MS);
163167
164168 setConfirmationProgress(0.2);
165169
@@ -248,7 +252,7 @@ export default function useEthereumTransaction(
248252
249253 setConfirmationProgress(1.0);
250254
251− await timeout(500); // wait for .animated-width to complete
255+ await timeout(PROGRESS_ANIMATION_DELAY_MS);
252256
253257 if (!mounted) {
254258 return;