mirror of https://github.com/usememos/memos.git
chore: use MEMOS_INSTANCE_URL for "Copy Link" (#4930)
This commit is contained in:
parent
1fcafd807e
commit
6005d0f3f7
|
|
@ -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…
Reference in New Issue