From 495e812071d4dfdfcae7c8728411db31cd439dd0 Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Thu, 9 Feb 2023 21:33:18 -0500 Subject: [PATCH] [O] Shorten code --- src/App.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index d6b5139..e349eea 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -55,9 +55,7 @@ export default function App() { function wheel(e: WheelEvent) { let direction = (e.detail < 0 || e.deltaY > 0) ? 1 : -1 - let dx = direction * 20 - - setBcLeft(Math.max(Math.min(bcLeft() + dx, bcMax), 0)) + setBcLeft(Math.max(Math.min(bcLeft() + direction * 20, bcMax), 0)) } // Set initial breadcrumb wheel to show the end path