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.

fix: copy-to-clipboard not works well in Safari (#1779)

Athurg Gooth55cf19aa2eb8
diff --git a/web/src/components/MemoList.tsx b/web/src/components/MemoList.tsx
index 8cf2c90ad..4e5799f13 100644
--- a/web/src/components/MemoList.tsx
+++ b/web/src/components/MemoList.tsx
@@ -9,7 +9,6 @@ import { checkShouldShowMemoWithFilters } from "@/helpers/filter";
import Memo from "./Memo";
import "@/less/memo-list.less";
import { PLAIN_LINK_REG } from "@/labs/marked/parser";
-import copy from "copy-to-clipboard";
const MemoList = () => {
const { t } = useTranslation();
@@ -151,21 +150,6 @@ const MemoList = () => {
}
};
- useEffect(() => {
- window.addEventListener("copy", handleCopy);
- return () => {
- window.removeEventListener("copy", handleCopy);
- };
- }, []);
-
- const handleCopy = (event: ClipboardEvent) => {
- event.preventDefault();
- const rawStr = document.getSelection()?.toString();
- if (rawStr !== undefined) {
- copy(rawStr.split("\n\n").join("\n"));
- }
- };
-
return (
<div className="memo-list-container">
{sortedMemos.map((memo) => (