diff options
author | Francesco Agosti <francesco.agosti93@gmail.com> | 2018-07-14 02:14:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-14 02:14:38 +0800 |
commit | 26363931ed8ba35a55073d00c4fe128c7e616acc (patch) | |
tree | 5a092a18fab2687a2d221209b947560f82884dcb /packages/website/ts/utils/utils.ts | |
parent | e2438330f588eba03d50c18943b24d6e7f9e9479 (diff) | |
parent | ee54438e92f191637ecb0d36e9d79e707d1c976c (diff) | |
download | dexon-0x-contracts-26363931ed8ba35a55073d00c4fe128c7e616acc.tar.gz dexon-0x-contracts-26363931ed8ba35a55073d00c4fe128c7e616acc.tar.zst dexon-0x-contracts-26363931ed8ba35a55073d00c4fe128c7e616acc.zip |
Merge pull request #866 from 0xProject/feature/website/integrate-heap
Integrate Heap analytics into the website
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 9ca7f607b..f18459598 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -313,14 +313,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; |