From b73676ad3c55d360bbae4fb7ae45bff06f9ac306 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:39:37 -0600 Subject: [PATCH] fix: populate url with tank ids --- packages/website/src/pages/tools/compare/_index.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/website/src/pages/tools/compare/_index.tsx b/packages/website/src/pages/tools/compare/_index.tsx index 104247bed..7dfda2113 100644 --- a/packages/website/src/pages/tools/compare/_index.tsx +++ b/packages/website/src/pages/tools/compare/_index.tsx @@ -103,6 +103,18 @@ function Content() { }); }, []); + useEffect(() => { + const search = new URLSearchParams(window.location.search); + + search.set('tanks', members.map((member) => member.tank.id).join(',')); + + window.history.replaceState( + {}, + '', + `${window.location.pathname}?${search.toString()}`, + ); + }, [members]); + return (