Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Jan 8, 2025
1 parent 0f2c30d commit 7c84916
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/scan/src/web/components/inspector/overlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,9 @@ export const ScanOverlay = () => {
const handleResizeOrScroll = () => {
const state = Store.inspectState.peek();
const canvas = refCanvas.current;
if (!canvas) return;
const ctx = canvas?.getContext('2d');
if (!canvas || !ctx) return;
if (!ctx) return;

cancelAnimationFrame(refRafId.current);
clearTimeout(refTimeout.current);
Expand Down Expand Up @@ -590,8 +591,9 @@ export const ScanOverlay = () => {

useEffect(() => {
const canvas = refCanvas.current;
if (!canvas) return;
const ctx = canvas?.getContext('2d');
if (!canvas || !ctx) return;
if (!ctx) return;

updateCanvasSize(canvas, ctx);

Expand Down

0 comments on commit 7c84916

Please sign in to comment.