aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils/utils.ts
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-07-14 02:14:38 +0800
committerGitHub <noreply@github.com>2018-07-14 02:14:38 +0800
commit26363931ed8ba35a55073d00c4fe128c7e616acc (patch)
tree5a092a18fab2687a2d221209b947560f82884dcb /packages/website/ts/utils/utils.ts
parente2438330f588eba03d50c18943b24d6e7f9e9479 (diff)
parentee54438e92f191637ecb0d36e9d79e707d1c976c (diff)
downloaddexon-sol-tools-26363931ed8ba35a55073d00c4fe128c7e616acc.tar
dexon-sol-tools-26363931ed8ba35a55073d00c4fe128c7e616acc.tar.gz
dexon-sol-tools-26363931ed8ba35a55073d00c4fe128c7e616acc.tar.bz2
dexon-sol-tools-26363931ed8ba35a55073d00c4fe128c7e616acc.tar.lz
dexon-sol-tools-26363931ed8ba35a55073d00c4fe128c7e616acc.tar.xz
dexon-sol-tools-26363931ed8ba35a55073d00c4fe128c7e616acc.tar.zst
dexon-sol-tools-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.ts11
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;