From cfff416e181fa03d7efc87f94c0adca09ee8a79a Mon Sep 17 00:00:00 2001 From: bkellam Date: Thu, 27 Feb 2025 12:25:35 -0800 Subject: [PATCH] fix share links --- .../web/src/app/[domain]/components/editorContextMenu.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/web/src/app/[domain]/components/editorContextMenu.tsx b/packages/web/src/app/[domain]/components/editorContextMenu.tsx index 24d45d2a..c392437d 100644 --- a/packages/web/src/app/[domain]/components/editorContextMenu.tsx +++ b/packages/web/src/app/[domain]/components/editorContextMenu.tsx @@ -8,7 +8,7 @@ import { autoPlacement, computePosition, offset, shift, VirtualElement } from "@ import { Link2Icon } from "@radix-ui/react-icons"; import { EditorView, SelectionRange } from "@uiw/react-codemirror"; import { useCallback, useEffect, useRef } from "react"; -import { resolveServerPath } from "../../api/(client)/client"; +import { useDomain } from "@/hooks/useDomain"; interface ContextMenuProps { view: EditorView; @@ -28,6 +28,7 @@ export const EditorContextMenu = ({ const ref = useRef(null); const { toast } = useToast(); const captureEvent = useCaptureEvent(); + const domain = useDomain(); useEffect(() => { if (selection.empty) { @@ -104,9 +105,7 @@ export const EditorContextMenu = ({ const from = toLineAndColumn(selection.from); const to = toLineAndColumn(selection.to); - // @note: we need to resolve the server path for /browse since - // we aren't using (which normally does this for us). - const basePath = `${window.location.origin}${resolveServerPath('/browse')}`; + const basePath = `${window.location.origin}/${domain}/browse`; const url = createPathWithQueryParams(`${basePath}/${repoName}@${revisionName}/-/blob/${path}`, ['highlightRange', `${from?.line}:${from?.column},${to?.line}:${to?.column}`], );