Skip to content

Commit

Permalink
Fix URL with trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
seladb committed Feb 15, 2024
1 parent 13fe2ec commit 48ed93d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const router = createHashRouter([
export default function App() {
React.useEffect(() => {
if (!window.location.hash) {
window.location.href = `${window.location.origin}/#/`;
const url = window.location.href;
const urlWithTrailingSlash = url.endsWith("/") ? url : url + "/";
window.location.href = `${urlWithTrailingSlash}#/`;
}

ReactGA.pageview(window.location.pathname + window.location.search);
Expand Down

0 comments on commit 48ed93d

Please sign in to comment.