Cleanup + migrate away from process.browser (#5408)
* Cleanup + migrate away from process.browser * Bring back HeadSeo in ui/v2
This commit is contained in:
@@ -8,10 +8,10 @@ import {
|
||||
constructMeetingImage,
|
||||
MeetingImageProps,
|
||||
} from "@calcom/lib/OgImages";
|
||||
import { truncate, truncateOnWord } from "@calcom/lib/text";
|
||||
import { getBrowserInfo } from "@calcom/lib/browser/browser.utils";
|
||||
import { truncateOnWord } from "@calcom/lib/text";
|
||||
|
||||
import { getSeoImage, seoConfig } from "@lib/config/next-seo.config";
|
||||
import { getBrowserInfo } from "@lib/core/browser/browser.utils";
|
||||
|
||||
export type HeadSeoProps = {
|
||||
title: string;
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
type BrowserInfo = {
|
||||
url: string;
|
||||
path: string;
|
||||
referrer: string;
|
||||
title: string;
|
||||
query: string;
|
||||
};
|
||||
|
||||
export const getBrowserInfo = (): Partial<BrowserInfo> => {
|
||||
if (!process.browser) {
|
||||
return {};
|
||||
}
|
||||
return {
|
||||
url: window.document.location?.href ?? undefined,
|
||||
path: window.document.location?.pathname ?? undefined,
|
||||
referrer: window.document?.referrer ?? undefined,
|
||||
title: window.document.title ?? undefined,
|
||||
query: window.document.location?.search,
|
||||
};
|
||||
};
|
||||
@@ -7,7 +7,7 @@ type BrowserInfo = {
|
||||
};
|
||||
|
||||
export const getBrowserInfo = (): Partial<BrowserInfo> => {
|
||||
if (!process.browser) {
|
||||
if (typeof window === "undefined") {
|
||||
return {};
|
||||
}
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user