From 7125e5822a8dfe8cf6b8a783169bd1867949229f Mon Sep 17 00:00:00 2001 From: nofurtherinformation Date: Fri, 29 Mar 2024 15:22:21 -0500 Subject: [PATCH] map tooltip render cleanup --- components/Map/Map.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/Map/Map.tsx b/components/Map/Map.tsx index 924c147..e6fdcf0 100644 --- a/components/Map/Map.tsx +++ b/components/Map/Map.tsx @@ -42,7 +42,7 @@ const Tooltip: React.FC<{ dataService: DataService }> = ({ dataService }) => { const { x, y, id } = tooltip || {} // @ts-ignore const data = dataService.tooltipResults[id] - const [_updateTrigger, setUpdateTrigger] = useState(true) + const [_updateTrigger, setUpdateTrigger] = useState(1) useEffect(() => { const main = async () => { @@ -50,7 +50,7 @@ const Tooltip: React.FC<{ dataService: DataService }> = ({ dataService }) => { return } const tooltipData = await dataService.getTooltipValues(id) - setUpdateTrigger((v) => !v) + setUpdateTrigger((v) => (v+1) % 100) } main() }, [id]) @@ -85,7 +85,15 @@ const Tooltip: React.FC<{ dataService: DataService }> = ({ dataService }) => { ) }) ) : ( -

Loading...

+
+ + + +

+ Loading... + +

+
)} )