fix alerts reconnect backoff and clipboard availability checks
release / build (push) Successful in 1m12s

This commit is contained in:
lda committed 2026-10-01 14:55:26 +07:00 Verified
1 parent 5d77b9aeb2
commit 53c274dbe8
4 files changed
+11

No files matched your search

+1
View File
@@ -207,6 +207,7 @@ export function App() {
// Only a connection that stayed up proves the stream is healthy; an
// accept-then-close server must not pin us to the first backoff step.
if (openedAt && Date.now() - openedAt > 10_000) attempt = 0;
openedAt = 0;
// Browsers never reconnect a WebSocket on their own.
const delay =
Math.min(30_000, 1000 * 2 ** attempt) + Math.random() * 1000;
+8
View File
@@ -172,6 +172,10 @@ export function useXterm({ pageRef, hostRef }: Options) {
toast.info("Nothing to copy");
return;
}
if (!navigator.clipboard) {
toast.error("Clipboard access requires HTTPS or localhost");
return;
}
try {
await navigator.clipboard.writeText(text);
toast.success(
@@ -184,6 +188,10 @@ export function useXterm({ pageRef, hostRef }: Options) {
}
}, []);
const paste = useCallback(async (writeData: (data: string) => void) => {
if (!navigator.clipboard) {
toast.error("Clipboard access requires HTTPS or localhost");
return;
}
try {
const text = await navigator.clipboard.readText();
if (text) writeData(text);