From bd7b40c15699cf68f30c11608420a6ce487e43a1 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Tue, 5 Dec 2023 15:42:45 +0100 Subject: [PATCH] Limit opening posthog.com links in side panel to docs --- frontend/src/lib/lemon-ui/Link/Link.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/lemon-ui/Link/Link.tsx b/frontend/src/lib/lemon-ui/Link/Link.tsx index bbbaacb3f42ec..3f7813e75f070 100644 --- a/frontend/src/lib/lemon-ui/Link/Link.tsx +++ b/frontend/src/lib/lemon-ui/Link/Link.tsx @@ -54,8 +54,8 @@ const isPostHogDomain = (url: string): boolean => { return /^https:\/\/((www|app|eu)\.)?posthog\.com/.test(url) } -const isPostHogComDomain = (url: string): boolean => { - return /^https:\/\/(www\.)?posthog\.com/.test(url) +const isPostHogComDocs = (url: string): boolean => { + return /^https:\/\/(www\.)?posthog\.com\/docs/.test(url) } /** @@ -103,7 +103,7 @@ export const Link: React.FC> = Reac return } - if (typeof to === 'string' && is3000 && isPostHogComDomain(to)) { + if (typeof to === 'string' && is3000 && isPostHogComDocs(to)) { event.preventDefault() openDocsPage(to) return