fix delete stuck UI
Some checks failed
CI / test-build (push) Has been cancelled

This commit is contained in:
2025-12-18 12:07:23 +07:00
parent 4ad93e7fe5
commit 945217c536

View File

@@ -256,7 +256,14 @@ function getAuthHeaders() {
async function loadPools() {
try {
const res = await fetch('/api/v1/pools', { headers: getAuthHeaders() });
// Add cache-busting to ensure fresh data
const res = await fetch('/api/v1/pools?_=' + Date.now(), {
headers: {
...getAuthHeaders(),
'Cache-Control': 'no-cache',
'Pragma': 'no-cache'
}
});
const data = await res.json().catch(() => null);
const listEl = document.getElementById('pools-list');
@@ -621,7 +628,9 @@ async function deletePool(name) {
});
if (res.ok) {
loadPools();
// Wait a moment for the deletion to fully complete, then refresh
await new Promise(resolve => setTimeout(resolve, 500));
await loadPools();
alert('Pool deleted successfully');
} else {
const err = await res.json();