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:
+3
-3
@@ -152,7 +152,7 @@ async function quickSearchPickEntry(entry, mode) {
|
||||
if (!u) { toast('No username on this entry', 'warning'); return; }
|
||||
if (Bridge.active) Bridge.copySecure(u, 30000);
|
||||
else { try { await navigator.clipboard.writeText(u); } catch (_) {} }
|
||||
toast('Username copied · clears in 30s');
|
||||
toast('Username copied' + clipClearSuffix());
|
||||
} else {
|
||||
const pwd = await decryptPwd(entry.encrypted_password, entry.iv);
|
||||
if (pwd === '[ERROR]') { toast('Decryption error', 'error'); return; }
|
||||
@@ -202,7 +202,7 @@ const CHEATSHEET_GROUPS = [
|
||||
title: 'On each card',
|
||||
items: [
|
||||
{ keys: [{ icon: 'i-globe' }], desc: 'Open the site in your default browser' },
|
||||
{ keys: [{ icon: 'i-copy' }], desc: 'Copy password to the secure clipboard (auto-clears in 30s)' },
|
||||
{ keys: [{ icon: 'i-copy' }], desc: 'Copy password to the secure clipboard (auto-clears)' },
|
||||
{ keys: ['Click card'], desc: 'Open the entry details / edit panel' },
|
||||
],
|
||||
},
|
||||
@@ -306,7 +306,7 @@ async function openHistoryModal(entryId) {
|
||||
copy.addEventListener('click', () => {
|
||||
if (Bridge.active) Bridge.copySecure(plain, 30000);
|
||||
else { try { navigator.clipboard.writeText(plain); } catch (_) {} }
|
||||
toast('Copied · clears in 30s');
|
||||
toast('Copied' + clipClearSuffix());
|
||||
});
|
||||
preview.appendChild(copy);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user