diff --git a/server/web/index.html b/server/web/index.html index e724d52..6c06e1a 100644 --- a/server/web/index.html +++ b/server/web/index.html @@ -147,7 +147,7 @@ const r = await fetch("/api/send", { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ type: "clipboard", text, source: "web" }), + body: JSON.stringify({ type: "clipboard", text, source: "web", from: peerID }), }); status(r.ok ? "delivered ✓" : "server returned " + r.status, r.ok ? "ok" : "err"); } catch (e) { status("network error", "err"); } @@ -207,7 +207,7 @@ es.addEventListener("clipboard", (ev) => { try { const m = JSON.parse(ev.data); - if (m.source !== "web") { + if (m.from !== peerID) { // hide our own sends, show everyone else addIncoming(m.text, m.source, m.ts, false); } } catch (e) {}