From ea3df4704608d9dd434366a4d373fa40f50c54ba Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 26 Feb 2022 23:29:10 +0100 Subject: [PATCH] removed any --- frontend/src/scripts/elements/monkey-power.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/scripts/elements/monkey-power.ts b/frontend/src/scripts/elements/monkey-power.ts index 0efabaa80..d9a1b6906 100644 --- a/frontend/src/scripts/elements/monkey-power.ts +++ b/frontend/src/scripts/elements/monkey-power.ts @@ -13,7 +13,7 @@ type Particle = { type CTX = { particles: Particle[]; - caret?: any; + caret?: JQuery; canvas?: HTMLCanvasElement; context2d?: CanvasRenderingContext2D; rendering: boolean; @@ -216,8 +216,11 @@ export async function addPower(good = true, extra = false): Promise { } // Sparks - const offset = ctx.caret.offset(); - const coords = [offset.left, offset.top + ctx.caret.height()]; + const offset = ctx.caret?.offset(); + const coords = [ + offset?.left ?? 0, + (offset?.top ?? 0) + (ctx.caret?.height() ?? 0), + ]; for ( let i = Math.round(