fix(clipboard): copy toasts reflect the configured clear delay

The "clears in 30s" suffix was hardcoded in ~14 toasts. Single helper
clipClearSuffix() reads clipboardClearSeconds (''=Never); prefixes concatenated
to it. Cheatsheet text made generic "(auto-clears)".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-07-12 19:42:26 +01:00
parent 8cfa1b0d6a
commit 2c7f6188e3
3 changed files with 21 additions and 14 deletions
+2 -2
View File
@@ -733,10 +733,10 @@ async function doGenerateRecoveryKey() {
// running embedded, navigator.clipboard with manual scrub
// otherwise.
if (Bridge.copySecure(code, 30000)) {
toast('Recovery code copied · clears in 30s');
toast('Recovery code copied' + clipClearSuffix());
} else {
navigator.clipboard.writeText(code).then(() => {
toast('Recovery code copied · clears in 30s');
toast('Recovery code copied' + clipClearSuffix());
setTimeout(() => navigator.clipboard.writeText('').catch(()=>{}), 30000);
});
}