diff --git a/static/js/detail-modal.js b/static/js/detail-modal.js index d529836..8cebb1d 100644 --- a/static/js/detail-modal.js +++ b/static/js/detail-modal.js @@ -16,8 +16,16 @@ async function viewCaptureDetails(captureId) { console.log('Loading state set, about to fetch from:', `/api/v1/captures/${captureId}`); try { - // Fetch capture details - const response = await fetch(`/api/v1/captures/${captureId}`); + // Fetch capture details with cache-busting + const cacheBuster = Date.now(); + const response = await fetch(`/api/v1/captures/${captureId}?_=${cacheBuster}`, { + method: 'GET', + headers: { + 'Cache-Control': 'no-cache, no-store, must-revalidate', + 'Pragma': 'no-cache', + 'Expires': '0' + } + }); console.log('Response status:', response.status); console.log('Response ok:', response.ok); @@ -222,6 +230,13 @@ function renderMatchedDevices(matches) { function closeDetailModal() { const modal = document.getElementById('detail-modal'); + const modalBody = document.getElementById('modal-body-content'); + + // Clear modal content to prevent stale data + if (modalBody) { + modalBody.innerHTML = ''; + } + modal.classList.remove('active'); }