From 9cc9e68d90921fb70b709925f1db55b7083a9b56 Mon Sep 17 00:00:00 2001 From: mrhid6 Date: Fri, 24 Jul 2026 11:06:57 +0100 Subject: [PATCH] fix: FIxed compile error --- web/components/NetworkBackground.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/web/components/NetworkBackground.tsx b/web/components/NetworkBackground.tsx index 4e8e555..17d272b 100644 --- a/web/components/NetworkBackground.tsx +++ b/web/components/NetworkBackground.tsx @@ -43,10 +43,11 @@ export function NetworkBackground() { const canvasRef = useRef(null); useEffect(() => { - const canvas = canvasRef.current; + const canvas: HTMLCanvasElement | null = canvasRef.current; if (!canvas) return; const ctx = canvas.getContext("2d"); if (!ctx) return; + const cvs: HTMLCanvasElement = canvas; const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches; @@ -138,10 +139,10 @@ export function NetworkBackground() { dpr = Math.min(window.devicePixelRatio || 1, 2); width = window.innerWidth; height = window.innerHeight; - canvas.width = Math.floor(width * dpr); - canvas.height = Math.floor(height * dpr); - canvas.style.width = `${width}px`; - canvas.style.height = `${height}px`; + cvs.width = Math.floor(width * dpr); + cvs.height = Math.floor(height * dpr); + cvs.style.width = `${width}px`; + cvs.style.height = `${height}px`; ctx.setTransform(dpr, 0, 0, dpr, 0, 0); build(); }