Remove isFromSignup param to prevent duplicate analytics hits (#4480)

This commit is contained in:
Rishabh Saxena 2021-05-21 13:20:27 +05:30 committed by GitHub
parent 6aa4d27330
commit 220c8d9d25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -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}>

View 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;