Fix clipboard copy on HTTP (non-secure) contexts, update docs

navigator.clipboard is undefined on non-HTTPS origins — add
execCommand fallback. Also sync CLAUDE.md with actual project
structure (Dockerfiles, nginx, CI, correct API/button descriptions).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mikhail KilinandClaude Opus 4.6 committed 2026-03-18 00:09:54 +03:00
1 parent b2c799f429
commit 7467206a5c
2 files changed
+19 -4

No files matched your search

+12 -1
View File
@@ -29,7 +29,18 @@ function App() {
const handleCopy = async (id: number) => {
const text = await getEntryContent(id);
navigator.clipboard.writeText(text);
if (navigator.clipboard) {
await navigator.clipboard.writeText(text);
} else {
const textarea = document.createElement("textarea");
textarea.value = text;
textarea.style.position = "fixed";
textarea.style.opacity = "0";
document.body.appendChild(textarea);
textarea.select();
document.execCommand("copy");
document.body.removeChild(textarea);
}
};
return (