Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the GA4 redirect logic without breaking the Bitly oauth2 flow #1997

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions src/components/Layout/GA4Toggle.tsx

This file was deleted.

8 changes: 6 additions & 2 deletions src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import { useGAVersion } from "../../hooks"
import { GAVersion, Url } from "../../constants"
import Spinner from "../Spinner"
import { linkData } from "./links"
import GA4Toggle from "./GA4Toggle"
import BugReport from "./BugReport"
import Loadable from "../Loadable"
import useLogin2, { UserStatus } from "./useLogin"
Expand Down Expand Up @@ -130,7 +129,12 @@ const Template: React.FC<PropsWithChildren<LayoutProps & TemplateProps>> = ({
const newLocation = window.location.href.replace( window.location.hostname, newHostname );
window.location.replace(newLocation);
}
//}, 1000);

if( !window.location.search && window.location.pathname === '/' ) {
const newLocation = window.location.pathname = '/ga4/';
window.location.replace(newLocation);
}
//}, 1000);

return;
}, []);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Spinner.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react"
import { styled } from '@mui/material/styles';
import { useTheme } from "@mui/material"
import {Circles} from "react-loader-spinner"
import { Circles } from 'react-loader-spinner'
import {PropsWithChildren} from 'react';

const PREFIX = 'Spinner';
Expand Down
Loading