Skip to content

Commit

Permalink
Merge pull request #806 from srliao/srl-20220818-use-absolute-url
Browse files Browse the repository at this point in the history
force redirect if on www
  • Loading branch information
srliao authored Aug 18, 2022
2 parents bf463da + b783ccc commit 2cf6cbf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ import { PageUserAccount } from './PageUserAccount';
export default function App() {
useTranslation();

React.useEffect(() => {
let loc = window.location.href;

if (loc.includes('www.gcsim.app')) {
loc = loc.replace('www.gcsim.app', 'gcsim.app');
window.location.href = loc;
}
}, [window.location.href]);

return (
<div className="bp4-dark h-screen flex flex-col">
<Nav />
Expand Down Expand Up @@ -56,7 +65,7 @@ export default function App() {
<Route path="/db">
<DB />
</Route>
<Route path="/db/:char">{({ char }) => <DbChar char={char} />}</Route>
{/* <Route path="/db/:char">{({ char }) => <DbChar char={char} />}</Route> */}
<Route path="/account">
<PageUserAccount />
</Route>
Expand Down

0 comments on commit 2cf6cbf

Please sign in to comment.