Remove isFromSignup param to prevent duplicate analytics hits (#4480)
This commit is contained in:
parent
6aa4d27330
commit
220c8d9d25
|
|
@ -26,7 +26,11 @@ import AppErrorBoundary from "./AppErrorBoundry";
|
|||
import GlobalStyles from "globalStyles";
|
||||
appInitializer();
|
||||
|
||||
import useRemoveSignUpCompleteParam from "utils/hooks/useRemoveSignUpCompleteParam";
|
||||
|
||||
function App() {
|
||||
useRemoveSignUpCompleteParam();
|
||||
|
||||
return (
|
||||
<Sentry.ErrorBoundary fallback={"An error has occured"}>
|
||||
<Provider store={store}>
|
||||
|
|
|
|||
21
app/client/src/utils/hooks/useRemoveSignUpCompleteParam.ts
Normal file
21
app/client/src/utils/hooks/useRemoveSignUpCompleteParam.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { useEffect } from "react";
|
||||
import history from "utils/history";
|
||||
|
||||
const useRemoveSignUpCompleteParam = () => {
|
||||
useEffect(() => {
|
||||
if (window.location.href) {
|
||||
const url = new URL(window.location.href);
|
||||
const searchParams = url.searchParams;
|
||||
if (searchParams.get("isFromSignup")) {
|
||||
searchParams.delete("isFromSignup");
|
||||
history.replace({
|
||||
pathname: url.pathname,
|
||||
search: url.search,
|
||||
hash: url.hash,
|
||||
});
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
};
|
||||
|
||||
export default useRemoveSignUpCompleteParam;
|
||||
Loading…
Reference in New Issue
Block a user