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

Optimisation codes #29

Merged
merged 6 commits into from
Oct 17, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: undo test to de-active redirect to home page ...
  • Loading branch information
qfdk committed Oct 15, 2022
commit bc0630ce85db2ee5c873e971ecf9b45bb3ee3ae2
22 changes: 11 additions & 11 deletions src/components/site/SiteLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 34,17 @@ export const SiteLayout: React.FC<SiteLayoutProps> = ({ children, title }) => {
siteId: domainOrSubdomain,
})

// useEffect(() => {
// if (site.data) {
// if (
// window.location.host.split(".").slice(-2).join(".") !== OUR_DOMAIN &&
// window.location.host !== site.data?.custom_domain &&
// IS_PROD
// ) {
// window.location.href = SITE_URL
// }
// }
// }, [site.isSuccess, site.data])
useEffect(() => {
if (site.data) {
if (
window.location.host.split(".").slice(-2).join(".") !== OUR_DOMAIN &&
window.location.host !== site.data?.custom_domain &&
IS_PROD
) {
window.location.href = SITE_URL
}
}
}, [site.isSuccess, site.data])

return (
<>
Expand Down