Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

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

Colin Holzman6005d0f3f786
diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx
index c91e8c7fe..051a9a8bc 100644
--- a/web/src/components/MemoActionMenu.tsx
+++ b/web/src/components/MemoActionMenu.tsx
@@ -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"));
};