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

pull/4922/head
Colin Holzman 3 months ago committed by GitHub
parent 1fcafd807e
commit 6005d0f3f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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"));
};

Loading…
Cancel
Save