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