refactor: trying copilot edits

This commit is contained in:
ayo 2026-06-02 14:01:36 +02:00
parent fd1d015a18
commit e77351e5dd

View file

@ -49,21 +49,29 @@ AP0YLC768PFTBm9CM5T1BE0xjJ7s4dZSrVoI4n8RSe1nCA==
<script> <script>
/* Clipboard copy logic */ /* Clipboard copy logic */
document.querySelector('.copy-btn').addEventListener('click', async () => { const copyBtn = document.querySelector('.copy-btn')
const keyText = document.querySelector('#public-key code').innerText.trim() if (copyBtn) {
try { copyBtn.addEventListener('click', async () => {
await navigator.clipboard.writeText(keyText) const keyText = (
const btn = document.querySelector('.copy-btn') document.querySelector('#public-key code') as HTMLElement
const original = btn.textContent )?.innerText.trim()
btn.textContent = 'Copied!' if (!keyText) return
setTimeout(() => { try {
btn.textContent = original await navigator.clipboard.writeText(keyText)
}, 2000) const btn = document.querySelector('.copy-btn')
} catch (err) { if (btn) {
console.error('Copy failed', err) const original = btn.textContent
alert('Unable to copy the key. Please copy it manually.') btn.textContent = 'Copied!'
} setTimeout(() => {
}) btn.textContent = original
}, 2000)
}
} catch (err) {
console.error('Copy failed', err)
alert('Unable to copy the key. Please copy it manually.')
}
})
}
</script> </script>
<style> <style>