Fix localhost

Handle automatic subdomain redirect
This commit is contained in:
Tom Moor
2018-11-03 22:40:33 -07:00
parent 6418712c47
commit 1be8e13828
6 changed files with 26 additions and 27 deletions

View File

@@ -24,6 +24,14 @@ const Auth = observer(({ auth, children }: Props) => {
return <LoadingIndicator />;
}
if (
team.subdomain &&
!window.location.hostname.startsWith(team.subdomain)
) {
window.location.href = `${team.url}${window.location.pathname}`;
return <LoadingIndicator />;
}
// Only initialize stores once. Kept in global scope because otherwise they
// will get overridden on route change
if (!authenticatedStores) {

View File

@@ -32,7 +32,7 @@ const RealButton = styled.button`
}
&:disabled {
opacity: 0.8;
opacity: 0.6;
cursor: default;
}