aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-03 00:01:46 +0800
committerFabio Berger <me@fabioberger.com>2018-03-03 00:01:46 +0800
commit0fbb443e4bb3ee6d522f4a4099aacae1b3da2488 (patch)
treef962c1c711da7a9c5bf478f361ad45b058b1f7ea /packages/website/ts/utils
parent8021694b81dd94c4ea75001476b0ab57e8e45e1c (diff)
downloaddexon-sol-tools-0fbb443e4bb3ee6d522f4a4099aacae1b3da2488.tar
dexon-sol-tools-0fbb443e4bb3ee6d522f4a4099aacae1b3da2488.tar.gz
dexon-sol-tools-0fbb443e4bb3ee6d522f4a4099aacae1b3da2488.tar.bz2
dexon-sol-tools-0fbb443e4bb3ee6d522f4a4099aacae1b3da2488.tar.lz
dexon-sol-tools-0fbb443e4bb3ee6d522f4a4099aacae1b3da2488.tar.xz
dexon-sol-tools-0fbb443e4bb3ee6d522f4a4099aacae1b3da2488.tar.zst
dexon-sol-tools-0fbb443e4bb3ee6d522f4a4099aacae1b3da2488.zip
Move onPageLoadAsync to utils
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r--packages/website/ts/utils/utils.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index 4d04d915d..27cd87be1 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -309,4 +309,12 @@ export const utils = {
containerId,
});
},
+ async onPageLoadAsync(): Promise<void> {
+ if (document.readyState === 'complete') {
+ return; // Already loaded
+ }
+ return new Promise<void>((resolve, reject) => {
+ window.onload = () => resolve();
+ });
+ },
};