chore: use MEMOS_INSTANCE_URL for "Copy Link" (#4930)
This commit is contained in:
parent
1fcafd807e
commit
6005d0f3f7
1 changed files with 6 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ import { useLocation } from "react-router-dom";
|
||||||
import { markdownServiceClient } from "@/grpcweb";
|
import { markdownServiceClient } from "@/grpcweb";
|
||||||
import useNavigateTo from "@/hooks/useNavigateTo";
|
import useNavigateTo from "@/hooks/useNavigateTo";
|
||||||
import { memoStore, userStore } from "@/store";
|
import { memoStore, userStore } from "@/store";
|
||||||
|
import { workspaceStore } from "@/store";
|
||||||
import { State } from "@/types/proto/api/v1/common";
|
import { State } from "@/types/proto/api/v1/common";
|
||||||
import { NodeType } from "@/types/proto/api/v1/markdown_service";
|
import { NodeType } from "@/types/proto/api/v1/markdown_service";
|
||||||
import { Memo } from "@/types/proto/api/v1/memo_service";
|
import { Memo } from "@/types/proto/api/v1/memo_service";
|
||||||
|
|
@ -114,7 +115,11 @@ const MemoActionMenu = observer((props: Props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCopyLink = () => {
|
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"));
|
toast.success(t("message.succeed-copy-link"));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue