fix(dashboard): update token refresh to target table body only

This commit is contained in:
Ray Andrew 2026-02-16 00:54:44 -06:00
parent 8922a65d28
commit c949498a7d
Signed by: rayandrew
SSH key fingerprint: SHA256:EUCV+qCSqkap8rR+p+zGjxHfKI06G0GJKgo1DIOniQY

View file

@ -119,13 +119,13 @@ document.getElementById('modal-create-token').addEventListener('click', function
if (e.target === this) closeModal();
});
// After token creation: show key, close modal, refresh token list
// After token creation: show key, close modal, refresh token table only
document.body.addEventListener('tokenCreated', function() {
closeModal();
document.getElementById('new-token-display').style.display = 'block';
// Refresh the token list after a short delay
// Refresh only the token table body, preserving the new-token-display
setTimeout(function() {
htmx.ajax('GET', '/tokens', {target: '#content', swap: 'innerHTML'});
htmx.ajax('GET', '/tokens', {target: '#tokens-tbody', select: '#tokens-tbody', swap: 'outerHTML'});
}, 100);
});