(c)
| 17418 | clearInterval(autoRefreshIntervals.pwn); |
| 17419 | } |
| 17420 | |
| 17421 | currentPwnStatusInterval = normalized; |
| 17422 | autoRefreshIntervals.pwn = setInterval(() => { |
| 17423 | if (currentTab === 'config' || currentTab === 'discovered') { |
| 17424 | refreshPwnagotchiStatus({ silent: true }); |
| 17425 | } |
| 17426 | }, normalized); |
| 17427 | } |
| 17428 | |
| 17429 | function initializePwnUI() { |
| 17430 | const badge = document.getElementById('pwn-status-badge'); |
| 17431 | if (!badge) { |
| 17432 | return; |
| 17433 | } |
| 17434 | |
| 17435 | const installBtn = document.getElementById('pwn-install-btn'); |
| 17436 | if (installBtn) { |
| 17437 | installBtn.addEventListener('click', handlePwnInstallClick); |
| 17438 | } |
| 17439 | |
| 17440 | const repairBtn = document.getElementById('pwn-repair-btn'); |
| 17441 | if (repairBtn) { |
| 17442 | repairBtn.addEventListener('click', handlePwnRepairClick); |
| 17443 | } |
| 17444 | |
| 17445 | const reinstallBtn = document.getElementById('pwn-reinstall-btn'); |
| 17446 | if (reinstallBtn) { |
| 17447 | reinstallBtn.addEventListener('click', handlePwnReinstallClick); |
| 17448 | } |
| 17449 | |
| 17450 | const swapToPwnBtn = document.getElementById('pwn-swap-to-pwn-btn'); |
| 17451 | if (swapToPwnBtn) { |
| 17452 | swapToPwnBtn.addEventListener('click', () => handlePwnSwap('pwnagotchi')); |
| 17453 | } |
| 17454 | |
| 17455 | const refreshBtn = document.getElementById('pwn-refresh-btn'); |
| 17456 | if (refreshBtn) { |
| 17457 | refreshBtn.addEventListener('click', () => refreshPwnagotchiStatus()); |
no test coverage detected