diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-07-14 02:15:50 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-07-14 02:15:50 +0800 |
commit | b70f5d1a1efcb3b07673aa3b4bc7bc2318f55462 (patch) | |
tree | d011565b1c95d4682381f8f573afadf98911e396 /packages/website/ts/utils/utils.ts | |
parent | c5fcdd06579b67b5b129749474acd9a4d1d4db65 (diff) | |
parent | 26363931ed8ba35a55073d00c4fe128c7e616acc (diff) | |
download | dexon-sol-tools-b70f5d1a1efcb3b07673aa3b4bc7bc2318f55462.tar dexon-sol-tools-b70f5d1a1efcb3b07673aa3b4bc7bc2318f55462.tar.gz dexon-sol-tools-b70f5d1a1efcb3b07673aa3b4bc7bc2318f55462.tar.bz2 dexon-sol-tools-b70f5d1a1efcb3b07673aa3b4bc7bc2318f55462.tar.lz dexon-sol-tools-b70f5d1a1efcb3b07673aa3b4bc7bc2318f55462.tar.xz dexon-sol-tools-b70f5d1a1efcb3b07673aa3b4bc7bc2318f55462.tar.zst dexon-sol-tools-b70f5d1a1efcb3b07673aa3b4bc7bc2318f55462.zip |
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into bug/website/txhash-error
Diffstat (limited to 'packages/website/ts/utils/utils.ts')
-rw-r--r-- | packages/website/ts/utils/utils.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index f2baeb849..739bb7b66 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -299,14 +299,13 @@ export const utils = { const baseUrl = `https://${window.location.hostname}${hasPort ? `:${port}` : ''}`; return baseUrl; }, - async onPageLoadAsync(): Promise<void> { + onPageLoadPromise: new Promise((resolve, _reject) => { if (document.readyState === 'complete') { - return; // Already loaded + resolve(); + return; } - return new Promise<void>((resolve, _reject) => { - window.onload = () => resolve(); - }); - }, + window.onload = resolve; + }), getProviderType(provider: Provider): Providers | string { const constructorName = provider.constructor.name; let parsedProviderName = constructorName; |