on master help sign in
fix: cleanup imports, add timing constnat
5088ea6Matt Condon (shrugs)
src/lib/constants.js+3
@@ -69,6 +69,8 @@ const PROFILE_STATES = {
69 INPUT_ERROR: Symbol('INPUT_ERROR'),
69 INPUT_ERROR: Symbol('INPUT_ERROR'),
70};
70};
71
71
72+const PROGRESS_ANIMATION_DELAY_MS = 500; // .animated-width
73+
72export {
74export {
73 CHECK_BLOCK_EVERY_MS,
75 CHECK_BLOCK_EVERY_MS,
74 DEFAULT_GAS_PRICE_GWEI,
76 DEFAULT_GAS_PRICE_GWEI,
@@ -87,4 +89,5 @@ export {
87 GALAXY_ENTROPY_BITS,
89 GALAXY_ENTROPY_BITS,
88 SEED_ENTROPY_BITS,
90 SEED_ENTROPY_BITS,
89 ZOD,
91 ZOD,
92+ PROGRESS_ANIMATION_DELAY_MS,
90};
93};
src/lib/useEthereumTransaction.js+10−6
@@ -6,7 +6,11 @@ import { useNetwork } from 'store/network';
6import { useWallet } from 'store/wallet';
6import { useWallet } from 'store/wallet';
7import { usePointCursor } from 'store/pointCursor';
7import { usePointCursor } from 'store/pointCursor';
8
8
9+import {
10+ GAS_LIMITS,
9−import { GAS_LIMITS, DEFAULT_GAS_PRICE_GWEI } from './constants';
11+ DEFAULT_GAS_PRICE_GWEI,
12+ PROGRESS_ANIMATION_DELAY_MS,
13+} from './constants';
10import {
14import {
11 signTransaction,
15 signTransaction,
12 sendSignedTransaction,
16 sendSignedTransaction,
@@ -15,9 +19,9 @@ import {
15} from './txn';
19} from './txn';
16import * as need from 'lib/need';
20import * as need from 'lib/need';
17import { ensureFundsFor } from 'lib/tank';
21import { ensureFundsFor } from 'lib/tank';
18−import useDeepEqualReference from './useDeepEqualReference';
22+import useDeepEqualReference from 'lib/useDeepEqualReference';
19−import useGasPrice from './useGasPrice';
23+import useGasPrice from 'lib/useGasPrice';
20−import timeout from './timeout';
24+import timeout from 'lib/timeout';
21
25
22const STATE = {
26const STATE = {
23 NONE: 'NONE',
27 NONE: 'NONE',
@@ -159,7 +163,7 @@ export default function useEthereumTransaction(
159 setState(STATE.BROADCASTED);
163 setState(STATE.BROADCASTED);
160 setTxHash(txHash);
164 setTxHash(txHash);
161
165
162− await timeout(500); // wait for .animated-width to complete
166+ await timeout(PROGRESS_ANIMATION_DELAY_MS);
163
167
164 setConfirmationProgress(0.2);
168 setConfirmationProgress(0.2);
165
169
@@ -248,7 +252,7 @@ export default function useEthereumTransaction(
248
252
249 setConfirmationProgress(1.0);
253 setConfirmationProgress(1.0);
250
254
251− await timeout(500); // wait for .animated-width to complete
255+ await timeout(PROGRESS_ANIMATION_DELAY_MS);
252
256
253 if (!mounted) {
257 if (!mounted) {
254 return;
258 return;