surface a clear message when copying the restic password fails

This commit is contained in:
Jarek Krochmalski committed 2026-09-06 17:04:18 +05:30
1 parent 84c959910a
commit 2b7958cb25
1 file changed
+8 -4
@@ -393,10 +393,14 @@
setTimeout(() => { generatedOk = false; }, 1500); setTimeout(() => { generatedOk = false; }, 1500);
} }
function copyPassword() { async function copyPassword() {
copyToClipboard(formPassword); const ok = await copyToClipboard(formPassword);
copiedOk = true; if (ok) {
setTimeout(() => { copiedOk = false; }, 1500); copiedOk = true;
setTimeout(() => { copiedOk = false; }, 1500);
} else {
toast.error('Could not copy to clipboard. Copy it manually, or use HTTPS to enable one-click copy.');
}
} }
function handleBackendChange(value: string) { function handleBackendChange(value: string) {