aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils/utils.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-12 06:39:12 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-12 06:39:12 +0800
commit098322c56475581df5bd80e12cb6c511963e4daf (patch)
treebed34b4b9b9be4ea124a7a3247db02e8e39d7ba2 /packages/website/ts/utils/utils.ts
parent9131a72a47690912db9b536186d05120daabd115 (diff)
downloaddexon-0x-contracts-098322c56475581df5bd80e12cb6c511963e4daf.tar.gz
dexon-0x-contracts-098322c56475581df5bd80e12cb6c511963e4daf.tar.zst
dexon-0x-contracts-098322c56475581df5bd80e12cb6c511963e4daf.zip
Integrate heap analytics
Diffstat (limited to 'packages/website/ts/utils/utils.ts')
-rw-r--r--packages/website/ts/utils/utils.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index df7f8d10f..bd6a57eea 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -313,15 +313,13 @@ export const utils = {
const baseUrl = `https://${window.location.hostname}${hasPort ? `:${port}` : ''}`;
return baseUrl;
},
- // TODO: Fix this, it's a lie.
- 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;