fix(dashboard): update token refresh to target table body only
This commit is contained in:
parent
8922a65d28
commit
c949498a7d
1 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue