From fe6ee7ddacb161ca997534e6639847f0f9567bc6 Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Fri, 9 Apr 2021 10:37:11 +0530 Subject: [PATCH 1/3] fix deploy --- deploy.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/deploy.ts b/deploy.ts index ffdc907..79bb5d2 100644 --- a/deploy.ts +++ b/deploy.ts @@ -75,6 +75,21 @@ export function handle( client.handle(cmd, handler) } +if (typeof (window as any).setTimeout !== 'function') { + Object.defineProperty(window, 'setTimeout', { + value: (fn: CallableFunction, _ms: number, ...args: any[]) => { + fn(...args) + return 0 + } + }) +} + +if (typeof (window as any).clearTimeout !== 'function') { + Object.defineProperty(window, 'clearTimeout', { + value: (_id: number) => {} + }) +} + export { commands, client } export * from './src/types/slash.ts' export * from './src/structures/slash.ts' From bd5153fd15e80469e8b5051db9df3cc82645e2ed Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Fri, 9 Apr 2021 10:39:35 +0530 Subject: [PATCH 2/3] cmt --- deploy.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy.ts b/deploy.ts index 79bb5d2..ad4df31 100644 --- a/deploy.ts +++ b/deploy.ts @@ -75,6 +75,8 @@ export function handle( client.handle(cmd, handler) } +// Hacky workaround. Timers don't exist in Deploy runtime, what a shame! + if (typeof (window as any).setTimeout !== 'function') { Object.defineProperty(window, 'setTimeout', { value: (fn: CallableFunction, _ms: number, ...args: any[]) => { From 12e6971b0a9b90aba5f3f0fb22c110c1126b6c88 Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Fri, 9 Apr 2021 11:02:31 +0530 Subject: [PATCH 3/3] fix --- deploy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.ts b/deploy.ts index ad4df31..0bbccf4 100644 --- a/deploy.ts +++ b/deploy.ts @@ -75,7 +75,7 @@ export function handle( client.handle(cmd, handler) } -// Hacky workaround. Timers don't exist in Deploy runtime, what a shame! +// Hacky workaround. Timers don't exist in Deploy runtime :( if (typeof (window as any).setTimeout !== 'function') { Object.defineProperty(window, 'setTimeout', {