Unverified Commit 6005d0f3 authored by Colin Holzman's avatar Colin Holzman Committed by GitHub

chore: use MEMOS_INSTANCE_URL for "Copy Link" (#4930)

parent 1fcafd80
......@@ -16,6 +16,7 @@ import { useLocation } from "react-router-dom";
import { markdownServiceClient } from "@/grpcweb";
import useNavigateTo from "@/hooks/useNavigateTo";
import { memoStore, userStore } from "@/store";
import { workspaceStore } from "@/store";
import { State } from "@/types/proto/api/v1/common";
import { NodeType } from "@/types/proto/api/v1/markdown_service";
import { Memo } from "@/types/proto/api/v1/memo_service";
......@@ -114,7 +115,11 @@ const MemoActionMenu = observer((props: Props) => {
};
const handleCopyLink = () => {
copy(`${window.location.origin}/${memo.name}`);
let host = workspaceStore.state.profile.instanceUrl;
if (host === "") {
host = window.location.origin;
}
copy(`${host}/${memo.name}`);
toast.success(t("message.succeed-copy-link"));
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment