From 767ca5ef9795ed2d47901ad8846634ba483e937b Mon Sep 17 00:00:00 2001 From: csawatzky Date: Fri, 18 Jul 2025 11:01:34 -0600 Subject: [PATCH] update to libracart access to pull the data from the url --- src/integrations/LibraCart/LibraCartAccess.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/integrations/LibraCart/LibraCartAccess.tsx b/src/integrations/LibraCart/LibraCartAccess.tsx index 738ce13..d2a3433 100644 --- a/src/integrations/LibraCart/LibraCartAccess.tsx +++ b/src/integrations/LibraCart/LibraCartAccess.tsx @@ -63,13 +63,21 @@ export default function LibraCartAccess() { } }, [teamKey, userAPI]); + // useEffect(() => { + // let code = localStorage.getItem("state"); + // if (code) { + // setLibraCartCode(code); + // setOpenDialog(true); + // } + // }, [searchParams, libracartCode]); + useEffect(() => { - let code = localStorage.getItem("state"); + let code = new URLSearchParams(window.location.search).get("state"); // not sure if the state is correct here i thought it should be the access_token if (code) { setLibraCartCode(code); setOpenDialog(true); } - }, [searchParams, libracartCode]); + }, [window.location]); const validate = () => { let invalid = false;