diff --git a/templates/dashboard.html b/templates/dashboard.html
index b2c012c..2d76dfd 100644
--- a/templates/dashboard.html
+++ b/templates/dashboard.html
@@ -447,8 +447,13 @@
clearInterval(pollInterval);
alert("Scan Error: " + state.results);
resetTables("Error: " + state.results);
+ } else if (state.status === 'idle') {
+ // Scan state lost (server restart?)
+ clearInterval(pollInterval);
+ alert("Scan state lost (Server Restarted?). Please try again.");
+ resetTables("Scan stopped / State lost.");
}
- // If 'scanning' or 'idle', keep polling...
+ // If 'scanning', keep polling...
} catch (e) {
clearInterval(pollInterval);
console.error("Poll error", e);