parent
4e7a1cd121
commit
4c56ed40f1
|
@ -31,6 +31,7 @@ import KeyboardShortcutsButton from "./KeyboardShortcutsButton";
|
|||
import MarkAsViewed from "./MarkAsViewed";
|
||||
import References from "./References";
|
||||
import { type LocationWithState } from "types";
|
||||
import { isCustomDomain } from "utils/domains";
|
||||
import { emojiToUrl } from "utils/emoji";
|
||||
import {
|
||||
collectionUrl,
|
||||
|
@ -458,7 +459,8 @@ class DocumentScene extends React.Component<Props> {
|
|||
</MaxWidth>
|
||||
</Container>
|
||||
</Background>
|
||||
{isShare ? <Branding /> : <KeyboardShortcutsButton />}
|
||||
{isShare && !isCustomDomain() && <Branding />}
|
||||
{!isShare && <KeyboardShortcutsButton />}
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
// @flow
|
||||
import { stripSubdomain } from "shared/utils/domains";
|
||||
import { parseDomain, stripSubdomain } from "shared/utils/domains";
|
||||
import env from "env";
|
||||
|
||||
export function getCookieDomain(domain: string) {
|
||||
return env.SUBDOMAINS_ENABLED ? stripSubdomain(domain) : domain;
|
||||
}
|
||||
|
||||
export function isCustomDomain() {
|
||||
const parsed = parseDomain(window.location.origin);
|
||||
const main = parseDomain(env.URL);
|
||||
|
||||
return (
|
||||
parsed && main && (main.domain !== parsed.domain || main.tld !== parsed.tld)
|
||||
);
|
||||
}
|
||||
|
|
Reference in New Issue