Fixed two bugs: selected cards staying visible after preview opens, and stale history results showing when a new scan starts.

This commit is contained in:
StyxX65 committed 2026-04-29 15:18:58 +02:00
1 parent ce5a5f1cbb
commit 78fb406422
4 files changed
+16 -1

No files matched your search

+4
View File
@@ -43,6 +43,8 @@ async function loadHistorySession(refScanId) {
let resolvedRef = refScanId;
if (resolvedRef === null) {
const sessions = _sessions !== null ? _sessions : await _fetchSessions();
// Bail if a scan started while we were fetching sessions
if (S._m365ScanRunning || S._googleScanRunning || S._fileScanRunning) return;
if (!sessions.length) {
// No scans in DB — nothing to show
window.loadLastScanSummary?.();
@@ -54,6 +56,8 @@ async function loadHistorySession(refScanId) {
try {
const r = await fetch('/api/db/flagged?ref=' + resolvedRef);
const items = await r.json();
// Bail if a scan started while we were fetching flagged items
if (S._m365ScanRunning || S._googleScanRunning || S._fileScanRunning) return;
closeHistoryPicker();
if (!Array.isArray(items) || items.length === 0) {
+1
View File
@@ -93,6 +93,7 @@ async function openPreview(f) {
panel.classList.remove('hidden');
const _savedW = sessionStorage.getItem('gdpr_preview_width');
if (_savedW) panel.style.width = _savedW + 'px';
if (cardEl) requestAnimationFrame(() => cardEl.scrollIntoView({ behavior: 'smooth', block: 'nearest' }));
title.textContent = f.name;
frame.style.display = 'none';
loading.style.display = 'flex';
+1 -1
View File
@@ -176,7 +176,7 @@ async function loadLastScanSummary() {
try {
const r = await fetch('/api/db/stats');
const d = await r.json();
if (!d.scan_id || S.flaggedData.length > 0) return;
if (!d.scan_id || S.flaggedData.length > 0 || S._m365ScanRunning || S._googleScanRunning || S._fileScanRunning) return;
const panel = document.getElementById('lastScanSummary');
const empty = document.getElementById('emptyState');
if (!panel || !empty) return;